From 1a53ddcc8f2981e7feaedba140ac8d02c1c8ce98 Mon Sep 17 00:00:00 2001 From: marcoschmickler Date: Fri, 11 Nov 2022 13:42:35 +0100 Subject: [PATCH] Tags --- hints.md | 10 +++++ kplayer.xcodeproj/project.pbxproj | 16 ++++++- kplayer/core/Cached+CoreDataClass.swift | 16 +++++++ kplayer/core/Cached+CoreDataProperties.swift | 31 ++++++++++++++ kplayer/core/KTag+CoreDataProperties.swift | 10 ++--- .../kplayer.xcdatamodeld/.xccurrentversion | 2 +- .../kplayer 4.xcdatamodel/contents | 42 +++++++++++++++++++ kplayer/video/SEmbeddedVideo.swift | 3 +- 8 files changed, 120 insertions(+), 10 deletions(-) create mode 100644 hints.md create mode 100644 kplayer/core/Cached+CoreDataClass.swift create mode 100644 kplayer/core/Cached+CoreDataProperties.swift create mode 100644 kplayer/kplayer.xcdatamodeld/kplayer 4.xcdatamodel/contents diff --git a/hints.md b/hints.md new file mode 100644 index 0000000..81016d2 --- /dev/null +++ b/hints.md @@ -0,0 +1,10 @@ +https://www.informit.com/articles/article.aspx?p=2469048 + +1. Select kplayer.xcdatamodel + +2. Click Editor > Add Model Version.... + +3. Click Finish to accept Model 2 as the version name. + + +Codegen ausschalten diff --git a/kplayer.xcodeproj/project.pbxproj b/kplayer.xcodeproj/project.pbxproj index 73a5068..9e010d7 100644 --- a/kplayer.xcodeproj/project.pbxproj +++ b/kplayer.xcodeproj/project.pbxproj @@ -70,6 +70,7 @@ 1C736E21B246C0BE7E123FD3 /* MediaModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736B41C6AC33F3FA592C63 /* MediaModel.swift */; }; 1C736EB38B780CA47B50772F /* SEmbeddedVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7367B39F09CCD1760A345A /* SEmbeddedVideo.swift */; }; 1C736EC45EE7DA5F7FCE63DA /* LocalManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73659CC9B523B957E58DC6 /* LocalManager.swift */; }; + 1C736EFF1E09988625FF770C /* hints.md in Sources */ = {isa = PBXBuildFile; fileRef = 1C736BF48D5CE855B6E75BE6 /* hints.md */; }; 1C736F2334FE0F946FD7CABE /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736E32C8574BFE3536F1C2 /* ImageCache.swift */; }; 1C736F6A223D4ADB2E1BA733 /* ItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736069C214E9522BB1BD97 /* ItemCell.swift */; }; 1C736F7D29B76C7037CEF778 /* DatabaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73647019E6C2E822127BA3 /* DatabaseManager.swift */; }; @@ -88,6 +89,8 @@ C98AF5E11B124D6A00D196CC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C98AF5E01B124D6A00D196CC /* Images.xcassets */; }; C98AF5E41B124D6A00D196CC /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C98AF5E21B124D6A00D196CC /* LaunchScreen.xib */; }; C98AF5F01B124D6A00D196CC /* kplayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98AF5EF1B124D6A00D196CC /* kplayerTests.swift */; }; + C9D67650291E73A00060179C /* Cached+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D6764E291E73A00060179C /* Cached+CoreDataClass.swift */; }; + C9D67651291E73A00060179C /* Cached+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D6764F291E73A00060179C /* Cached+CoreDataProperties.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -153,6 +156,7 @@ 1C736B41C6AC33F3FA592C63 /* MediaModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaModel.swift; sourceTree = ""; }; 1C736B794396F2E50387B8F2 /* stringutil.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = stringutil.swift; sourceTree = ""; }; 1C736BC4450890C45F8FBC63 /* LayoutTools.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutTools.swift; sourceTree = ""; }; + 1C736BF48D5CE855B6E75BE6 /* hints.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = hints.md; sourceTree = ""; }; 1C736C17C40DAE162AF8DDE3 /* WebViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewModel.swift; sourceTree = ""; }; 1C736C72CDF8902484856B3B /* SelfSizingHostingController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelfSizingHostingController.swift; sourceTree = ""; }; 1C736C94157754DE1C808173 /* KSettingsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSettingsModel.swift; sourceTree = ""; }; @@ -188,6 +192,9 @@ C98AF5EE1B124D6A00D196CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C98AF5EF1B124D6A00D196CC /* kplayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = kplayerTests.swift; sourceTree = ""; }; C9B052432905C56F002F65C0 /* kplayer 3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "kplayer 3.xcdatamodel"; sourceTree = ""; }; + C9D67649291E6E680060179C /* kplayer 4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "kplayer 4.xcdatamodel"; sourceTree = ""; }; + C9D6764E291E73A00060179C /* Cached+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Cached+CoreDataClass.swift"; sourceTree = ""; }; + C9D6764F291E73A00060179C /* Cached+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Cached+CoreDataProperties.swift"; sourceTree = ""; }; DF1DF76780D9CDC55209D1CE /* Pods-kplayer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-kplayer.release.xcconfig"; path = "Pods/Target Support Files/Pods-kplayer/Pods-kplayer.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -291,6 +298,8 @@ 1C736DC8C3AFB991541A2079 /* core */ = { isa = PBXGroup; children = ( + C9D6764E291E73A00060179C /* Cached+CoreDataClass.swift */, + C9D6764F291E73A00060179C /* Cached+CoreDataProperties.swift */, C91E05832795AC5C0003AB79 /* KTag+CoreDataClass.swift */, C91E05842795AC5C0003AB79 /* KTag+CoreDataProperties.swift */, C91E05852795AC5C0003AB79 /* KItem+CoreDataClass.swift */, @@ -366,6 +375,7 @@ 1C73685B4BBFDAFBF08C032C /* readme.md */, 1C7369BED02028D8564E82D5 /* pathfinder.scpt */, 1C7360F9649E40B7C2EAB581 /* kplayer.txt */, + 1C736BF48D5CE855B6E75BE6 /* hints.md */, ); sourceTree = ""; }; @@ -619,6 +629,7 @@ 1C7368242038C0FF6C9631E7 /* VideoHelper.swift in Sources */, 1C736A06A2AD75B8C14EEBBE /* HtmlParser.swift in Sources */, 1C736048BFA120F5C7D36874 /* readme.md in Sources */, + C9D67650291E73A00060179C /* Cached+CoreDataClass.swift in Sources */, 1C736771C503FB0D52AEB8F7 /* kplayer.js in Sources */, C91E058D2795AC5C0003AB79 /* KSnapshot+CoreDataClass.swift in Sources */, 1C7361B3AF46CEB30D3F4FA0 /* KSettings.swift in Sources */, @@ -628,6 +639,7 @@ C91E058A2795AC5C0003AB79 /* KTag+CoreDataProperties.swift in Sources */, C91E058B2795AC5C0003AB79 /* KItem+CoreDataClass.swift in Sources */, 1C736A622876405F3EE2D043 /* EditItemView.swift in Sources */, + C9D67651291E73A00060179C /* Cached+CoreDataProperties.swift in Sources */, 1C73613562EB375F53A0BD03 /* ServerDownloadDelegate.swift in Sources */, 1C736EC45EE7DA5F7FCE63DA /* LocalManager.swift in Sources */, 1C736DFD076D9CC30F0B9D58 /* Utility.swift in Sources */, @@ -659,6 +671,7 @@ 1C736EB38B780CA47B50772F /* SEmbeddedVideo.swift in Sources */, 1C736F2334FE0F946FD7CABE /* ImageCache.swift in Sources */, 1C7366BEA68D6E4CEE43417E /* ImageLoader.swift in Sources */, + 1C736EFF1E09988625FF770C /* hints.md in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -921,10 +934,11 @@ C98AF5D61B124D6A00D196CC /* kplayer.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + C9D67649291E6E680060179C /* kplayer 4.xcdatamodel */, C9B052432905C56F002F65C0 /* kplayer 3.xcdatamodel */, C98AF5D71B124D6A00D196CC /* kplayer.xcdatamodel */, ); - currentVersion = C9B052432905C56F002F65C0 /* kplayer 3.xcdatamodel */; + currentVersion = C9D67649291E6E680060179C /* kplayer 4.xcdatamodel */; path = kplayer.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; diff --git a/kplayer/core/Cached+CoreDataClass.swift b/kplayer/core/Cached+CoreDataClass.swift new file mode 100644 index 0000000..88ab758 --- /dev/null +++ b/kplayer/core/Cached+CoreDataClass.swift @@ -0,0 +1,16 @@ +// +// Cached+CoreDataClass.swift +// kplayer +// +// Created by Marco Schmickler on 11.11.22. +// Copyright © 2022 Marco Schmickler. All rights reserved. +// +// + +import Foundation +import CoreData + +@objc(Cached) +public class Cached: NSManagedObject { + +} diff --git a/kplayer/core/Cached+CoreDataProperties.swift b/kplayer/core/Cached+CoreDataProperties.swift new file mode 100644 index 0000000..e8378bd --- /dev/null +++ b/kplayer/core/Cached+CoreDataProperties.swift @@ -0,0 +1,31 @@ +// +// Cached+CoreDataProperties.swift +// kplayer +// +// Created by Marco Schmickler on 11.11.22. +// Copyright © 2022 Marco Schmickler. All rights reserved. +// +// + +import Foundation +import CoreData + + +extension Cached { + + @nonobjc public class func fetchRequest() -> NSFetchRequest { + return NSFetchRequest(entityName: "Cached") + } + + @NSManaged public var url: String? + @NSManaged public var cached: String? + @NSManaged public var used: Date? + @NSManaged public var times: Int16 + @NSManaged public var preferred: Int16 + @NSManaged public var options: String? + +} + +extension Cached : Identifiable { + +} diff --git a/kplayer/core/KTag+CoreDataProperties.swift b/kplayer/core/KTag+CoreDataProperties.swift index c32ffec..1387d28 100644 --- a/kplayer/core/KTag+CoreDataProperties.swift +++ b/kplayer/core/KTag+CoreDataProperties.swift @@ -1,9 +1,8 @@ // // KTag+CoreDataProperties.swift -// kplayer +// // -// Created by Marco Schmickler on 17.01.22. -// Copyright © 2022 Marco Schmickler. All rights reserved. +// Created by Marco Schmickler on 11.11.22. // // @@ -18,6 +17,7 @@ extension KTag { } @NSManaged public var name: String? + @NSManaged public var path: String? @NSManaged public var tagged: NSSet? } @@ -38,7 +38,3 @@ extension KTag { @NSManaged public func removeFromTagged(_ values: NSSet) } - -extension KTag : Identifiable { - -} diff --git a/kplayer/kplayer.xcdatamodeld/.xccurrentversion b/kplayer/kplayer.xcdatamodeld/.xccurrentversion index 3a28ba0..d719def 100644 --- a/kplayer/kplayer.xcdatamodeld/.xccurrentversion +++ b/kplayer/kplayer.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - kplayer 3.xcdatamodel + kplayer 4.xcdatamodel diff --git a/kplayer/kplayer.xcdatamodeld/kplayer 4.xcdatamodel/contents b/kplayer/kplayer.xcdatamodeld/kplayer 4.xcdatamodel/contents new file mode 100644 index 0000000..17fd214 --- /dev/null +++ b/kplayer/kplayer.xcdatamodeld/kplayer 4.xcdatamodel/contents @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kplayer/video/SEmbeddedVideo.swift b/kplayer/video/SEmbeddedVideo.swift index 1d827f4..b72d459 100644 --- a/kplayer/video/SEmbeddedVideo.swift +++ b/kplayer/video/SEmbeddedVideo.swift @@ -29,7 +29,7 @@ struct SEmbeddedVideo: View { } var body: some View { - VStack { + ZStack { VideoPlayerView(model: model, player: player).onAppear{ // if let url = LocalManager.sharedInstance.settings.embeddedVideoUrl { // playUrl(url: url) @@ -74,6 +74,7 @@ struct SEmbeddedVideo: View { controls = !controls }.contentShape(Rectangle()) let c = VStack { + Spacer() VideoPlayerControlsView(model: model, player: player) HStack { Button(action: {