From de632aeb7ef13db94ebd45aca384ab28e19f976b Mon Sep 17 00:00:00 2001 From: Aiden Vigue Date: Tue, 15 Jun 2021 19:56:49 -0400 Subject: [PATCH] add some views - rename a few folders. --- JellyfinPlayer tvOS/ConnectToServerView.swift | 136 ++++++++++++++++++ JellyfinPlayer tvOS/ContentView.swift | 5 - .../JellyfinPlayer tvOS.entitlements | 11 ++ .../.xccurrentversion | 5 +- ...ence.swift => PersistenceController.swift} | 2 +- JellyfinPlayer tvOS/SplashView.swift | 25 ++++ JellyfinPlayer.xcodeproj/project.pbxproj | 72 +++++----- .../xcshareddata/swiftpm/Package.resolved | 6 +- .../ServerEnvironment.swift | 0 .../SessionManager.swift | 0 .../ConnectToServerViewModel.swift | 0 .../HomeViewModel.swift | 0 .../LibraryListViewModel.swift | 0 .../SettingsViewModel.swift | 0 .../SplashViewModel.swift | 0 .../{ViewModel => ViewModels}/ViewModel.swift | 0 16 files changed, 215 insertions(+), 47 deletions(-) create mode 100644 JellyfinPlayer tvOS/ConnectToServerView.swift create mode 100644 JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements rename JellyfinPlayer tvOS/{Persistence.swift => PersistenceController.swift} (97%) create mode 100644 JellyfinPlayer tvOS/SplashView.swift rename Shared/{Shared => Singleton}/ServerEnvironment.swift (100%) rename Shared/{Shared => Singleton}/SessionManager.swift (100%) rename Shared/{ViewModel => ViewModels}/ConnectToServerViewModel.swift (100%) rename Shared/{ViewModel => ViewModels}/HomeViewModel.swift (100%) rename Shared/{ViewModel => ViewModels}/LibraryListViewModel.swift (100%) rename Shared/{ViewModel => ViewModels}/SettingsViewModel.swift (100%) rename Shared/{ViewModel => ViewModels}/SplashViewModel.swift (100%) rename Shared/{ViewModel => ViewModels}/ViewModel.swift (100%) diff --git a/JellyfinPlayer tvOS/ConnectToServerView.swift b/JellyfinPlayer tvOS/ConnectToServerView.swift new file mode 100644 index 00000000..de8b8dc5 --- /dev/null +++ b/JellyfinPlayer tvOS/ConnectToServerView.swift @@ -0,0 +1,136 @@ +/* JellyfinPlayer/Swiftfin is subject to the terms of the Mozilla Public + * License, v2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright 2021 Aiden Vigue & Jellyfin Contributors + */ + +import JellyfinAPI +import SwiftUI + +struct ConnectToServerView: View { + @StateObject var viewModel = ConnectToServerViewModel() + + @Binding var isLoggedIn: Bool + + var body: some View { + ZStack { + Form { + if viewModel.isConnectedServer { + if viewModel.publicUsers.isEmpty { + Section(header: Text("Login to \(ServerEnvironment.current.server.name ?? "")")) { + TextField("Username", text: $viewModel.username) + .disableAutocorrection(true) + .autocapitalization(.none) + SecureField("Password", text: $viewModel.password) + .disableAutocorrection(true) + .autocapitalization(.none) + Button { + viewModel.login() + } label: { + HStack { + Text("Login") + Spacer() + if viewModel.isLoading { + ProgressView() + } + } + }.disabled(viewModel.isLoading || viewModel.username.isEmpty) + } + + Section { + Button { + viewModel.isConnectedServer = false + } label: { + HStack { + HStack { + Image(systemName: "chevron.left") + Text("Change Server") + } + Spacer() + } + } + } + } else { + Section(header: Text("Login to \(ServerEnvironment.current.server.name ?? "")")) { + ForEach(viewModel.publicUsers, id: \.id) { publicUser in + HStack { + Button(action: { + viewModel.username = publicUser.name ?? "" + viewModel.publicUsers.removeAll() + if !(publicUser.hasPassword ?? true) { + viewModel.password = "" + viewModel.login() + } + }) { + HStack { + Text(publicUser.name ?? "").font(.subheadline).fontWeight(.semibold) + Spacer() + if publicUser.primaryImageTag != nil { + ImageView(src: URL(string: "\(ServerEnvironment.current.server.baseURI ?? "")/Users/\(publicUser.id ?? "")/Images/Primary?width=200&quality=80&tag=\(publicUser.primaryImageTag!)")!) + .frame(width: 60, height: 60) + .cornerRadius(30.0) + } else { + Image(systemName: "person.fill") + .foregroundColor(Color(red: 1, green: 1, blue: 1).opacity(0.8)) + .font(.system(size: 35)) + .frame(width: 60, height: 60) + .background(Color(red: 98 / 255, green: 121 / 255, blue: 205 / 255)) + .cornerRadius(30.0) + .shadow(radius: 6) + } + } + } + } + } + } + + Section { + Button { + viewModel.publicUsers.removeAll() + viewModel.username = "" + } label: { + HStack { + Text("Other User").font(.subheadline).fontWeight(.semibold) + Spacer() + Image(systemName: "person.fill.questionmark") + .foregroundColor(Color(red: 1, green: 1, blue: 1).opacity(0.8)) + .font(.system(size: 35)) + .frame(width: 60, height: 60) + .background(Color(red: 98 / 255, green: 121 / 255, blue: 205 / 255)) + .cornerRadius(30.0) + .shadow(radius: 6) + } + } + } + } + } else { + Section(header: Text("Server Information")) { + TextField("Jellyfin Server URL", text: $viewModel.uri) + .disableAutocorrection(true) + .autocapitalization(.none) + Button { + viewModel.connectToServer() + } label: { + HStack { + Text("Connect") + Spacer() + } + if viewModel.isLoading { + ProgressView() + } + } + .disabled(viewModel.isLoading || viewModel.uri.isEmpty) + } + } + } + } + .alert(item: $viewModel.errorMessage) { _ in + Alert(title: Text("Error"), message: Text("message"), dismissButton: .default(Text("Try again"))) + } + .onReceive(viewModel.$isLoggedIn, perform: { flag in + isLoggedIn = flag + }) + .navigationTitle("Connect to Server") + } +} diff --git a/JellyfinPlayer tvOS/ContentView.swift b/JellyfinPlayer tvOS/ContentView.swift index dc8f7627..eb320d11 100644 --- a/JellyfinPlayer tvOS/ContentView.swift +++ b/JellyfinPlayer tvOS/ContentView.swift @@ -11,11 +11,6 @@ import CoreData struct ContentView: View { @Environment(\.managedObjectContext) private var viewContext - @FetchRequest( - sortDescriptors: [NSSortDescriptor(keyPath: \Item.timestamp, ascending: true)], - animation: .default) - private var items: FetchedResults - var body: some View { NavigationView { List { diff --git a/JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements b/JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements new file mode 100644 index 00000000..8d925a13 --- /dev/null +++ b/JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements @@ -0,0 +1,11 @@ + + + + + com.apple.developer.user-management + + get-current-user + runs-as-current-user + + + diff --git a/JellyfinPlayer tvOS/JellyfinPlayer_tvOS.xcdatamodeld/.xccurrentversion b/JellyfinPlayer tvOS/JellyfinPlayer_tvOS.xcdatamodeld/.xccurrentversion index c7f0bb2c..0c67376e 100644 --- a/JellyfinPlayer tvOS/JellyfinPlayer_tvOS.xcdatamodeld/.xccurrentversion +++ b/JellyfinPlayer tvOS/JellyfinPlayer_tvOS.xcdatamodeld/.xccurrentversion @@ -1,8 +1,5 @@ - - _XCCurrentVersionName - JellyfinPlayer_tvOS.xcdatamodel - + diff --git a/JellyfinPlayer tvOS/Persistence.swift b/JellyfinPlayer tvOS/PersistenceController.swift similarity index 97% rename from JellyfinPlayer tvOS/Persistence.swift rename to JellyfinPlayer tvOS/PersistenceController.swift index 13833d5e..5d7dfb93 100644 --- a/JellyfinPlayer tvOS/Persistence.swift +++ b/JellyfinPlayer tvOS/PersistenceController.swift @@ -31,7 +31,7 @@ struct PersistenceController { let container: NSPersistentContainer init(inMemory: Bool = false) { - container = NSPersistentContainer(name: "JellyfinPlayer_tvOS") + container = NSPersistentContainer(name: "JellyfinPlayer") if inMemory { container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null") } diff --git a/JellyfinPlayer tvOS/SplashView.swift b/JellyfinPlayer tvOS/SplashView.swift new file mode 100644 index 00000000..59217c70 --- /dev/null +++ b/JellyfinPlayer tvOS/SplashView.swift @@ -0,0 +1,25 @@ +// +/* + * SwiftFin is subject to the terms of the Mozilla Public + * License, v2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright 2021 Aiden Vigue & Jellyfin Contributors + */ + +import SwiftUI + +struct SplashView: View { + @StateObject var viewModel = SplashViewModel() + + var body: some View { + if viewModel.isLoggedIn { + Text("home") + } else { + NavigationView { + ConnectToServerView(isLoggedIn: $viewModel.isLoggedIn) + } + .navigationViewStyle(StackNavigationViewStyle()) + } + } +} diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index 08590758..164e8125 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 531AC8BF26750DE20091C7EB /* ImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 531AC8BE26750DE20091C7EB /* ImageView.swift */; }; 5321753B2671BCFC005491E6 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5321753A2671BCFC005491E6 /* SettingsViewModel.swift */; }; 5321753E2671DE9C005491E6 /* Typings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535870AC2669D8DD00D05A09 /* Typings.swift */; }; - 5321753F2671DEA6005491E6 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5321753A2671BCFC005491E6 /* SettingsViewModel.swift */; }; 532175402671EE4F005491E6 /* LibraryFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E4E646263F6CF100F67C6B /* LibraryFilterView.swift */; }; 53313B90265EEA6D00947AA3 /* VideoPlayer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53313B8F265EEA6D00947AA3 /* VideoPlayer.storyboard */; }; 53352571265EA0A0006CCA86 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 53352570265EA0A0006CCA86 /* Introspect */; }; @@ -22,8 +21,7 @@ 535870652669D21600D05A09 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535870642669D21600D05A09 /* ContentView.swift */; }; 535870672669D21700D05A09 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 535870662669D21700D05A09 /* Assets.xcassets */; }; 5358706A2669D21700D05A09 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 535870692669D21700D05A09 /* Preview Assets.xcassets */; }; - 5358706C2669D21700D05A09 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5358706B2669D21700D05A09 /* Persistence.swift */; }; - 5358706F2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5358706D2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodeld */; }; + 5358706C2669D21700D05A09 /* PersistenceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5358706B2669D21700D05A09 /* PersistenceController.swift */; }; 5358707E2669D64F00D05A09 /* bitrates.json in Resources */ = {isa = PBXBuildFile; fileRef = AE8C3158265D6F90008AA076 /* bitrates.json */; }; 5358708D2669D7A800D05A09 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 5358708C2669D7A800D05A09 /* KeychainSwift */; }; 535870912669D7A800D05A09 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 535870902669D7A800D05A09 /* Introspect */; }; @@ -52,6 +50,15 @@ 53A089D0264DA9DA00D57806 /* MovieItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A089CF264DA9DA00D57806 /* MovieItemView.swift */; }; 53A431BD266B0FF20016769F /* JellyfinAPI in Frameworks */ = {isa = PBXBuildFile; productRef = 53A431BC266B0FF20016769F /* JellyfinAPI */; }; 53A431BF266B0FFE0016769F /* JellyfinAPI in Frameworks */ = {isa = PBXBuildFile; productRef = 53A431BE266B0FFE0016769F /* JellyfinAPI */; }; + 53ABFDDC267972BF00886593 /* TVServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53ABFDDB267972BF00886593 /* TVServices.framework */; }; + 53ABFDDE267974E300886593 /* SplashView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53ABFDDD267974E300886593 /* SplashView.swift */; }; + 53ABFDE4267974EF00886593 /* LibraryListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 625CB5742678C33500530A6E /* LibraryListViewModel.swift */; }; + 53ABFDE5267974EF00886593 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 625CB57B2678CE1000530A6E /* ViewModel.swift */; }; + 53ABFDE6267974EF00886593 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5321753A2671BCFC005491E6 /* SettingsViewModel.swift */; }; + 53ABFDE7267974EF00886593 /* ConnectToServerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 625CB5762678C34300530A6E /* ConnectToServerViewModel.swift */; }; + 53ABFDE8267974EF00886593 /* SplashViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 625CB5692678B71200530A6E /* SplashViewModel.swift */; }; + 53ABFDE9267974EF00886593 /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 625CB5722678C32A00530A6E /* HomeViewModel.swift */; }; + 53ABFDEB2679753200886593 /* ConnectToServerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53ABFDEA2679753200886593 /* ConnectToServerView.swift */; }; 53AD124D267029D60094A276 /* SeriesItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA526572F0700E7EA70 /* SeriesItemView.swift */; }; 53AD124E26702B8A0094A276 /* SeasonItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA326572C1300E7EA70 /* SeasonItemView.swift */; }; 53DE4BD02670961400739748 /* EpisodeItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA72657424A00E7EA70 /* EpisodeItemView.swift */; }; @@ -173,8 +180,7 @@ 535870642669D21600D05A09 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 535870662669D21700D05A09 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 535870692669D21700D05A09 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - 5358706B2669D21700D05A09 /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = ""; }; - 5358706E2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = JellyfinPlayer_tvOS.xcdatamodel; sourceTree = ""; }; + 5358706B2669D21700D05A09 /* PersistenceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistenceController.swift; sourceTree = ""; }; 535870702669D21700D05A09 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 535870AC2669D8DD00D05A09 /* Typings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Typings.swift; sourceTree = ""; }; 535BAE9E2649E569005FA86D /* ItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemView.swift; sourceTree = ""; }; @@ -196,6 +202,10 @@ 53987CA72657424A00E7EA70 /* EpisodeItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeItemView.swift; sourceTree = ""; }; 539B2DA4263BA5B8007FF1A4 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 53A089CF264DA9DA00D57806 /* MovieItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieItemView.swift; sourceTree = ""; }; + 53ABFDDA267972BF00886593 /* JellyfinPlayer tvOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "JellyfinPlayer tvOS.entitlements"; sourceTree = ""; }; + 53ABFDDB267972BF00886593 /* TVServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TVServices.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS15.0.sdk/System/Library/Frameworks/TVServices.framework; sourceTree = DEVELOPER_DIR; }; + 53ABFDDD267974E300886593 /* SplashView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashView.swift; sourceTree = ""; }; + 53ABFDEA2679753200886593 /* ConnectToServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectToServerView.swift; sourceTree = ""; }; 53AD124C2670278D0094A276 /* JellyfinPlayer.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = JellyfinPlayer.entitlements; sourceTree = ""; }; 53D5E3DA264B460200BADDC8 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; 53D5E3DC264B47EE00BADDC8 /* MobileVLCKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MobileVLCKit.xcframework; path = Carthage/Build/MobileVLCKit.xcframework; sourceTree = ""; }; @@ -244,6 +254,7 @@ 535870912669D7A800D05A09 /* Introspect in Frameworks */, 625CB57E2678E81E00530A6E /* TVVLCKit.xcframework in Frameworks */, 5358708D2669D7A800D05A09 /* KeychainSwift in Frameworks */, + 53ABFDDC267972BF00886593 /* TVServices.framework in Frameworks */, 5358709B2669D7A800D05A09 /* NukeUI in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -276,7 +287,7 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 532175392671BCED005491E6 /* ViewModel */ = { + 532175392671BCED005491E6 /* ViewModels */ = { isa = PBXGroup; children = ( 5321753A2671BCFC005491E6 /* SettingsViewModel.swift */, @@ -286,19 +297,21 @@ 625CB5762678C34300530A6E /* ConnectToServerViewModel.swift */, 625CB57B2678CE1000530A6E /* ViewModel.swift */, ); - path = ViewModel; + path = ViewModels; sourceTree = ""; }; 535870612669D21600D05A09 /* JellyfinPlayer tvOS */ = { isa = PBXGroup; children = ( + 53ABFDDA267972BF00886593 /* JellyfinPlayer tvOS.entitlements */, 535870622669D21600D05A09 /* JellyfinPlayer_tvOSApp.swift */, 535870642669D21600D05A09 /* ContentView.swift */, 535870662669D21700D05A09 /* Assets.xcassets */, - 5358706B2669D21700D05A09 /* Persistence.swift */, + 5358706B2669D21700D05A09 /* PersistenceController.swift */, 535870702669D21700D05A09 /* Info.plist */, - 5358706D2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodeld */, 535870682669D21700D05A09 /* Preview Content */, + 53ABFDDD267974E300886593 /* SplashView.swift */, + 53ABFDEA2679753200886593 /* ConnectToServerView.swift */, ); path = "JellyfinPlayer tvOS"; sourceTree = ""; @@ -314,8 +327,8 @@ 535870752669D60C00D05A09 /* Shared */ = { isa = PBXGroup; children = ( - 62EC352A26766657000E9F2D /* Shared */, - 532175392671BCED005491E6 /* ViewModel */, + 62EC352A26766657000E9F2D /* Singleton */, + 532175392671BCED005491E6 /* ViewModels */, 621338912660106C00A81A2A /* Extensions */, AE8C3157265D6F5E008AA076 /* Resources */, 535870AB2669D8D300D05A09 /* Typings */, @@ -357,7 +370,6 @@ 5377CBF3263B596A003A4E83 /* JellyfinPlayer */ = { isa = PBXGroup; children = ( - 625CB56D2678C1C400530A6E /* ViewModels */, 53AD124C2670278D0094A276 /* JellyfinPlayer.entitlements */, 5377CBF8263B596B003A4E83 /* Assets.xcassets */, 5338F74D263B61370014BF09 /* ConnectToServerView.swift */, @@ -403,6 +415,7 @@ 53D5E3DB264B47EE00BADDC8 /* Frameworks */ = { isa = PBXGroup; children = ( + 53ABFDDB267972BF00886593 /* TVServices.framework */, 625CB57D2678E81E00530A6E /* TVVLCKit.xcframework */, 53D5E3DC264B47EE00BADDC8 /* MobileVLCKit.xcframework */, 628B95212670CABD0091AF3B /* WidgetKit.framework */, @@ -427,13 +440,6 @@ path = Extensions; sourceTree = ""; }; - 625CB56D2678C1C400530A6E /* ViewModels */ = { - isa = PBXGroup; - children = ( - ); - path = ViewModels; - sourceTree = ""; - }; 628B95252670CABD0091AF3B /* WidgetExtension */ = { isa = PBXGroup; children = ( @@ -446,13 +452,13 @@ path = WidgetExtension; sourceTree = ""; }; - 62EC352A26766657000E9F2D /* Shared */ = { + 62EC352A26766657000E9F2D /* Singleton */ = { isa = PBXGroup; children = ( 62EC352B26766675000E9F2D /* ServerEnvironment.swift */, 62EC352E267666A5000E9F2D /* SessionManager.swift */, ); - path = Shared; + path = Singleton; sourceTree = ""; }; AE8C3157265D6F5E008AA076 /* Resources */ = { @@ -629,20 +635,26 @@ buildActionMask = 2147483647; files = ( 6267B3DC2671139500A7371D /* ImageExtensions.swift in Sources */, + 53ABFDE9267974EF00886593 /* HomeViewModel.swift in Sources */, 62EC352D26766675000E9F2D /* ServerEnvironment.swift in Sources */, + 53ABFDDE267974E300886593 /* SplashView.swift in Sources */, + 53ABFDE8267974EF00886593 /* SplashViewModel.swift in Sources */, 62EC3530267666A5000E9F2D /* SessionManager.swift in Sources */, 535870A82669D8AE00D05A09 /* StringExtensions.swift in Sources */, + 53ABFDE6267974EF00886593 /* SettingsViewModel.swift in Sources */, 6267B3D826710B9800A7371D /* CollectionExtensions.swift in Sources */, 535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */, 535870A72669D8AE00D05A09 /* MultiSelectorView.swift in Sources */, - 5358706C2669D21700D05A09 /* Persistence.swift in Sources */, - 5321753F2671DEA6005491E6 /* SettingsViewModel.swift in Sources */, + 53ABFDE7267974EF00886593 /* ConnectToServerViewModel.swift in Sources */, + 5358706C2669D21700D05A09 /* PersistenceController.swift in Sources */, 535870AA2669D8AE00D05A09 /* BlurHashDecode.swift in Sources */, + 53ABFDE5267974EF00886593 /* ViewModel.swift in Sources */, 535870652669D21600D05A09 /* ContentView.swift in Sources */, 535870A62669D8AE00D05A09 /* LazyView.swift in Sources */, - 5358706F2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodeld in Sources */, 5321753E2671DE9C005491E6 /* Typings.swift in Sources */, + 53ABFDEB2679753200886593 /* ConnectToServerView.swift in Sources */, 535870632669D21600D05A09 /* JellyfinPlayer_tvOSApp.swift in Sources */, + 53ABFDE4267974EF00886593 /* LibraryListViewModel.swift in Sources */, 5364F456266CA0DC0026ECBA /* APIExtensions.swift in Sources */, 535870A32669D89F00D05A09 /* Model.xcdatamodeld in Sources */, ); @@ -732,6 +744,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 43; DEVELOPMENT_ASSET_PATHS = "\"JellyfinPlayer tvOS/Preview Content\""; @@ -761,6 +774,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 43; DEVELOPMENT_ASSET_PATHS = "\"JellyfinPlayer tvOS/Preview Content\""; @@ -1175,16 +1189,6 @@ /* End XCSwiftPackageProductDependency section */ /* Begin XCVersionGroup section */ - 5358706D2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodeld */ = { - isa = XCVersionGroup; - children = ( - 5358706E2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodel */, - ); - currentVersion = 5358706E2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodel */; - path = JellyfinPlayer_tvOS.xcdatamodeld; - sourceTree = ""; - versionGroupType = wrapper.xcdatamodel; - }; 5377CBFF263B596B003A4E83 /* Model.xcdatamodeld */ = { isa = XCVersionGroup; children = ( diff --git a/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index cb410d09..0dae625c 100644 --- a/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -29,7 +29,7 @@ } }, { - "package": "JellyfinAPI", + "package": "jellyfin-sdk-swift", "repositoryURL": "https://github.com/jellyfin/jellyfin-sdk-swift", "state": { "branch": "main", @@ -38,7 +38,7 @@ } }, { - "package": "KeychainSwift", + "package": "keychain-swift", "repositoryURL": "https://github.com/evgenyneu/keychain-swift", "state": { "branch": null, @@ -65,7 +65,7 @@ } }, { - "package": "Introspect", + "package": "SwiftUI-Introspect", "repositoryURL": "https://github.com/siteline/SwiftUI-Introspect", "state": { "branch": null, diff --git a/Shared/Shared/ServerEnvironment.swift b/Shared/Singleton/ServerEnvironment.swift similarity index 100% rename from Shared/Shared/ServerEnvironment.swift rename to Shared/Singleton/ServerEnvironment.swift diff --git a/Shared/Shared/SessionManager.swift b/Shared/Singleton/SessionManager.swift similarity index 100% rename from Shared/Shared/SessionManager.swift rename to Shared/Singleton/SessionManager.swift diff --git a/Shared/ViewModel/ConnectToServerViewModel.swift b/Shared/ViewModels/ConnectToServerViewModel.swift similarity index 100% rename from Shared/ViewModel/ConnectToServerViewModel.swift rename to Shared/ViewModels/ConnectToServerViewModel.swift diff --git a/Shared/ViewModel/HomeViewModel.swift b/Shared/ViewModels/HomeViewModel.swift similarity index 100% rename from Shared/ViewModel/HomeViewModel.swift rename to Shared/ViewModels/HomeViewModel.swift diff --git a/Shared/ViewModel/LibraryListViewModel.swift b/Shared/ViewModels/LibraryListViewModel.swift similarity index 100% rename from Shared/ViewModel/LibraryListViewModel.swift rename to Shared/ViewModels/LibraryListViewModel.swift diff --git a/Shared/ViewModel/SettingsViewModel.swift b/Shared/ViewModels/SettingsViewModel.swift similarity index 100% rename from Shared/ViewModel/SettingsViewModel.swift rename to Shared/ViewModels/SettingsViewModel.swift diff --git a/Shared/ViewModel/SplashViewModel.swift b/Shared/ViewModels/SplashViewModel.swift similarity index 100% rename from Shared/ViewModel/SplashViewModel.swift rename to Shared/ViewModels/SplashViewModel.swift diff --git a/Shared/ViewModel/ViewModel.swift b/Shared/ViewModels/ViewModel.swift similarity index 100% rename from Shared/ViewModel/ViewModel.swift rename to Shared/ViewModels/ViewModel.swift