diff --git a/JellyfinPlayer tvOS/ContentView.swift b/JellyfinPlayer tvOS/ContentView.swift index 92252a90..dc8f7627 100644 --- a/JellyfinPlayer tvOS/ContentView.swift +++ b/JellyfinPlayer tvOS/ContentView.swift @@ -1,9 +1,9 @@ -// -// ContentView.swift -// JellyfinPlayer tvOS -// -// Created by Aiden Vigue on 6/3/21. -// +/* 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 SwiftUI import CoreData diff --git a/JellyfinPlayer tvOS/Info.plist b/JellyfinPlayer tvOS/Info.plist index 16d307cc..4897485f 100644 --- a/JellyfinPlayer tvOS/Info.plist +++ b/JellyfinPlayer tvOS/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Jellyfin CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion 1 LSRequiresIPhoneOS diff --git a/JellyfinPlayer tvOS/JellyfinPlayer_tvOSApp.swift b/JellyfinPlayer tvOS/JellyfinPlayer_tvOSApp.swift index 8fcc586d..a8973d18 100644 --- a/JellyfinPlayer tvOS/JellyfinPlayer_tvOSApp.swift +++ b/JellyfinPlayer tvOS/JellyfinPlayer_tvOSApp.swift @@ -1,9 +1,9 @@ -// -// JellyfinPlayer_tvOSApp.swift -// JellyfinPlayer tvOS -// -// Created by Aiden Vigue on 6/3/21. -// +/* 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 SwiftUI diff --git a/JellyfinPlayer tvOS/Persistence.swift b/JellyfinPlayer tvOS/Persistence.swift index 2a336074..e3ed50ab 100644 --- a/JellyfinPlayer tvOS/Persistence.swift +++ b/JellyfinPlayer tvOS/Persistence.swift @@ -1,9 +1,9 @@ -// -// Persistence.swift -// JellyfinPlayer tvOS -// -// Created by Aiden Vigue on 6/3/21. -// +/* 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 CoreData diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index 15f6ba64..3a2e40ad 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -19,7 +19,6 @@ 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 */; }; - 535870742669D22F00D05A09 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5377CBF8263B596B003A4E83 /* Assets.xcassets */; }; 5358707E2669D64F00D05A09 /* bitrates.json in Resources */ = {isa = PBXBuildFile; fileRef = AE8C3158265D6F90008AA076 /* bitrates.json */; }; 5358708B2669D7A800D05A09 /* SwiftyRequest in Frameworks */ = {isa = PBXBuildFile; productRef = 5358708A2669D7A800D05A09 /* SwiftyRequest */; }; 5358708D2669D7A800D05A09 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 5358708C2669D7A800D05A09 /* KeychainSwift */; }; @@ -33,11 +32,11 @@ 5358709D2669D82900D05A09 /* TVVLCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5358709C2669D82900D05A09 /* TVVLCKit.framework */; }; 5358709E2669D82900D05A09 /* TVVLCKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5358709C2669D82900D05A09 /* TVVLCKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 535870A32669D89F00D05A09 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5377CBFF263B596B003A4E83 /* Model.xcdatamodeld */; }; - 535870A52669D8AE00D05A09 /* ParallaxHeaderScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6225FCCA2663841E00E067F6 /* ParallaxHeaderScrollView.swift */; }; + 535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6225FCCA2663841E00E067F6 /* ParallaxHeader.swift */; }; 535870A62669D8AE00D05A09 /* LazyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338B22660A07800A81A2A /* LazyView.swift */; }; 535870A72669D8AE00D05A09 /* MultiSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E4E648263F725B00F67C6B /* MultiSelector.swift */; }; - 535870A82669D8AE00D05A09 /* String++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338922660107500A81A2A /* String++.swift */; }; - 535870A92669D8AE00D05A09 /* LazyImage++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621C638126676728004216EA /* LazyImage++.swift */; }; + 535870A82669D8AE00D05A09 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338922660107500A81A2A /* String.swift */; }; + 535870A92669D8AE00D05A09 /* LazyImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621C638126676728004216EA /* LazyImage.swift */; }; 535870AA2669D8AE00D05A09 /* BlurHashDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5389277B263CC3DB0035E14B /* BlurHashDecode.swift */; }; 535870AD2669D8DD00D05A09 /* Typings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535870AC2669D8DD00D05A09 /* Typings.swift */; }; 535BAE9F2649E569005FA86D /* ItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535BAE9E2649E569005FA86D /* ItemView.swift */; }; @@ -59,6 +58,10 @@ 53987CA82657424A00E7EA70 /* EpisodeItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA72657424A00E7EA70 /* EpisodeItemView.swift */; }; 539B2DA5263BA5B8007FF1A4 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 539B2DA4263BA5B8007FF1A4 /* SettingsView.swift */; }; 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 */; }; + 53C4404E266C75C70049424C /* HandleAPIRequestCompletion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C4404D266C75C70049424C /* HandleAPIRequestCompletion.swift */; }; + 53C4404F266C75C70049424C /* HandleAPIRequestCompletion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C4404D266C75C70049424C /* HandleAPIRequestCompletion.swift */; }; 53D5E3DD264B47EE00BADDC8 /* MobileVLCKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53D5E3DC264B47EE00BADDC8 /* MobileVLCKit.xcframework */; }; 53D5E3DE264B47EE00BADDC8 /* MobileVLCKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 53D5E3DC264B47EE00BADDC8 /* MobileVLCKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 53DF641E263D9C0600A7CD1A /* LibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53DF641D263D9C0600A7CD1A /* LibraryView.swift */; }; @@ -69,15 +72,15 @@ 53FF7F2A263CF3F500585C35 /* LatestMediaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FF7F29263CF3F500585C35 /* LatestMediaView.swift */; }; 6213388E265F777C00A81A2A /* LibraryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6213388D265F777C00A81A2A /* LibraryViewModel.swift */; }; 62133890265F83A900A81A2A /* LibraryListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6213388F265F83A900A81A2A /* LibraryListView.swift */; }; - 621338932660107500A81A2A /* String++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338922660107500A81A2A /* String++.swift */; }; + 621338932660107500A81A2A /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338922660107500A81A2A /* String.swift */; }; 62133895266096EF00A81A2A /* LibraryListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62133894266096EF00A81A2A /* LibraryListViewModel.swift */; }; 621338B32660A07800A81A2A /* LazyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338B22660A07800A81A2A /* LazyView.swift */; }; 621C638026672A30004216EA /* NukeUI in Frameworks */ = {isa = PBXBuildFile; productRef = 621C637F26672A30004216EA /* NukeUI */; }; - 621C638226676728004216EA /* LazyImage++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621C638126676728004216EA /* LazyImage++.swift */; }; - 6225FCCB2663841E00E067F6 /* ParallaxHeaderScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6225FCCA2663841E00E067F6 /* ParallaxHeaderScrollView.swift */; }; + 621C638226676728004216EA /* LazyImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621C638126676728004216EA /* LazyImage.swift */; }; + 6225FCCB2663841E00E067F6 /* ParallaxHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6225FCCA2663841E00E067F6 /* ParallaxHeader.swift */; }; 6273DD43265F4195009C1D0B /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 6273DD42265F4195009C1D0B /* Moya */; }; 6273DD45265F4195009C1D0B /* CombineMoya in Frameworks */ = {isa = PBXBuildFile; productRef = 6273DD44265F4195009C1D0B /* CombineMoya */; }; - 6273DD48265F41B3009C1D0B /* JellyfinAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6273DD47265F41B3009C1D0B /* JellyfinAPI.swift */; }; + 6273DD48265F41B3009C1D0B /* JellyfinAPIOld.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6273DD47265F41B3009C1D0B /* JellyfinAPIOld.swift */; }; 6273DD4E265F47B2009C1D0B /* LibrarySearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6273DD4D265F47B2009C1D0B /* LibrarySearchViewModel.swift */; }; AE8C3154265D60BF008AA076 /* SettingsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C3153265D60BF008AA076 /* SettingsModel.swift */; }; AE8C3156265D616A008AA076 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C3155265D616A008AA076 /* SettingsViewModel.swift */; }; @@ -121,6 +124,7 @@ /* Begin PBXFileReference section */ 53192D5C265AA78A008A4215 /* DeviceProfileBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceProfileBuilder.swift; sourceTree = ""; }; 53313B8F265EEA6D00947AA3 /* VideoPlayer.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = VideoPlayer.storyboard; sourceTree = ""; }; + 5333A68A266BDDC10044FD6B /* JellyfinPlayer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = JellyfinPlayer.entitlements; sourceTree = ""; }; 5338F74D263B61370014BF09 /* ConnectToServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectToServerView.swift; sourceTree = ""; }; 535870602669D21600D05A09 /* JellyfinPlayer tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "JellyfinPlayer tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 535870622669D21600D05A09 /* JellyfinPlayer_tvOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JellyfinPlayer_tvOSApp.swift; sourceTree = ""; }; @@ -152,6 +156,7 @@ 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 = ""; }; + 53C4404D266C75C70049424C /* HandleAPIRequestCompletion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandleAPIRequestCompletion.swift; 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 = ""; }; 53DF641D263D9C0600A7CD1A /* LibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryView.swift; sourceTree = ""; }; @@ -162,12 +167,12 @@ 53FF7F29263CF3F500585C35 /* LatestMediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LatestMediaView.swift; sourceTree = ""; }; 6213388D265F777C00A81A2A /* LibraryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryViewModel.swift; sourceTree = ""; }; 6213388F265F83A900A81A2A /* LibraryListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListView.swift; sourceTree = ""; }; - 621338922660107500A81A2A /* String++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String++.swift"; sourceTree = ""; }; + 621338922660107500A81A2A /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; 62133894266096EF00A81A2A /* LibraryListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListViewModel.swift; sourceTree = ""; }; 621338B22660A07800A81A2A /* LazyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LazyView.swift; sourceTree = ""; }; - 621C638126676728004216EA /* LazyImage++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LazyImage++.swift"; sourceTree = ""; }; - 6225FCCA2663841E00E067F6 /* ParallaxHeaderScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallaxHeaderScrollView.swift; sourceTree = ""; }; - 6273DD47265F41B3009C1D0B /* JellyfinAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JellyfinAPI.swift; sourceTree = ""; }; + 621C638126676728004216EA /* LazyImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LazyImage.swift; sourceTree = ""; }; + 6225FCCA2663841E00E067F6 /* ParallaxHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallaxHeader.swift; sourceTree = ""; }; + 6273DD47265F41B3009C1D0B /* JellyfinAPIOld.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JellyfinAPIOld.swift; sourceTree = ""; }; 6273DD4D265F47B2009C1D0B /* LibrarySearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrarySearchViewModel.swift; sourceTree = ""; }; AE8C3153265D60BF008AA076 /* SettingsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsModel.swift; sourceTree = ""; }; AE8C3155265D616A008AA076 /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = ""; }; @@ -180,6 +185,7 @@ buildActionMask = 2147483647; files = ( 535870972669D7A800D05A09 /* ReactiveMoya in Frameworks */, + 53A431BF266B0FFE0016769F /* JellyfinAPI in Frameworks */, 5358708F2669D7A800D05A09 /* SwiftyJSON in Frameworks */, 535870912669D7A800D05A09 /* Introspect in Frameworks */, 535870952669D7A800D05A09 /* Moya in Frameworks */, @@ -203,6 +209,7 @@ 5338F754263B65E10014BF09 /* SwiftyRequest in Frameworks */, 53352571265EA0A0006CCA86 /* Introspect in Frameworks */, 621C638026672A30004216EA /* NukeUI in Frameworks */, + 53A431BD266B0FF20016769F /* JellyfinAPI in Frameworks */, 5389277A263CBFE70035E14B /* SwiftyJSON in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -235,6 +242,7 @@ 535870752669D60C00D05A09 /* Shared */ = { isa = PBXGroup; children = ( + 621338912660106C00A81A2A /* Extensions */, 535870AB2669D8D300D05A09 /* Typings */, AE8C3157265D6F5E008AA076 /* Resources */, ); @@ -273,8 +281,8 @@ 5377CBF3263B596A003A4E83 /* JellyfinPlayer */ = { isa = PBXGroup; children = ( + 5333A68A266BDDC10044FD6B /* JellyfinPlayer.entitlements */, 6273DD46265F419B009C1D0B /* APIs */, - 621338912660106C00A81A2A /* Extensions */, AE8C3152265D607B008AA076 /* ViewModels */, AE8C3151265D6075008AA076 /* Models */, AE8C3150265D5FE1008AA076 /* Views */, @@ -325,9 +333,10 @@ 5389277B263CC3DB0035E14B /* BlurHashDecode.swift */, 53E4E648263F725B00F67C6B /* MultiSelector.swift */, 621338B22660A07800A81A2A /* LazyView.swift */, - 621338922660107500A81A2A /* String++.swift */, - 6225FCCA2663841E00E067F6 /* ParallaxHeaderScrollView.swift */, - 621C638126676728004216EA /* LazyImage++.swift */, + 621338922660107500A81A2A /* String.swift */, + 6225FCCA2663841E00E067F6 /* ParallaxHeader.swift */, + 621C638126676728004216EA /* LazyImage.swift */, + 53C4404D266C75C70049424C /* HandleAPIRequestCompletion.swift */, ); path = Extensions; sourceTree = ""; @@ -336,7 +345,7 @@ isa = PBXGroup; children = ( 53892776263CBB000035E14B /* JellyApiTypings.swift */, - 6273DD47265F41B3009C1D0B /* JellyfinAPI.swift */, + 6273DD47265F41B3009C1D0B /* JellyfinAPIOld.swift */, ); path = APIs; sourceTree = ""; @@ -408,6 +417,7 @@ 535870962669D7A800D05A09 /* ReactiveMoya */, 535870982669D7A800D05A09 /* RxMoya */, 5358709A2669D7A800D05A09 /* NukeUI */, + 53A431BE266B0FFE0016769F /* JellyfinAPI */, ); productName = "JellyfinPlayer tvOS"; productReference = 535870602669D21600D05A09 /* JellyfinPlayer tvOS.app */; @@ -436,6 +446,7 @@ 6273DD42265F4195009C1D0B /* Moya */, 6273DD44265F4195009C1D0B /* CombineMoya */, 621C637F26672A30004216EA /* NukeUI */, + 53A431BC266B0FF20016769F /* JellyfinAPI */, ); productName = JellyfinPlayer; productReference = 5377CBF1263B596A003A4E83 /* JellyfinPlayer.app */; @@ -477,6 +488,7 @@ 5335256F265EA0A0006CCA86 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */, 6273DD41265F4195009C1D0B /* XCRemoteSwiftPackageReference "Moya" */, 621C637E26672A30004216EA /* XCRemoteSwiftPackageReference "NukeUI" */, + 53A431BB266B0FF20016769F /* XCRemoteSwiftPackageReference "jellyfin-sdk-swift" */, ); productRefGroup = 5377CBF2263B596A003A4E83 /* Products */; projectDirPath = ""; @@ -494,7 +506,6 @@ buildActionMask = 2147483647; files = ( 5358706A2669D21700D05A09 /* Preview Assets.xcassets in Resources */, - 535870742669D22F00D05A09 /* Assets.xcassets in Resources */, 535870672669D21700D05A09 /* Assets.xcassets in Resources */, 5358707E2669D64F00D05A09 /* bitrates.json in Resources */, ); @@ -518,14 +529,15 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 535870A82669D8AE00D05A09 /* String++.swift in Sources */, - 535870A52669D8AE00D05A09 /* ParallaxHeaderScrollView.swift in Sources */, + 535870A82669D8AE00D05A09 /* String.swift in Sources */, + 535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */, 535870A72669D8AE00D05A09 /* MultiSelector.swift in Sources */, - 535870A92669D8AE00D05A09 /* LazyImage++.swift in Sources */, + 535870A92669D8AE00D05A09 /* LazyImage.swift in Sources */, 5358706C2669D21700D05A09 /* Persistence.swift in Sources */, 535870AA2669D8AE00D05A09 /* BlurHashDecode.swift in Sources */, 535870652669D21600D05A09 /* ContentView.swift in Sources */, 535870A62669D8AE00D05A09 /* LazyView.swift in Sources */, + 53C4404F266C75C70049424C /* HandleAPIRequestCompletion.swift in Sources */, 5358706F2669D21700D05A09 /* JellyfinPlayer_tvOS.xcdatamodeld in Sources */, 535870632669D21600D05A09 /* JellyfinPlayer_tvOSApp.swift in Sources */, 535870A32669D89F00D05A09 /* Model.xcdatamodeld in Sources */, @@ -536,13 +548,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 621338932660107500A81A2A /* String++.swift in Sources */, - 621C638226676728004216EA /* LazyImage++.swift in Sources */, + 621338932660107500A81A2A /* String.swift in Sources */, + 621C638226676728004216EA /* LazyImage.swift in Sources */, 53FF7F2A263CF3F500585C35 /* LatestMediaView.swift in Sources */, 5377CBFE263B596B003A4E83 /* PersistenceController.swift in Sources */, 5389276E263C25100035E14B /* ContinueWatchingView.swift in Sources */, 535BAE9F2649E569005FA86D /* ItemView.swift in Sources */, - 6225FCCB2663841E00E067F6 /* ParallaxHeaderScrollView.swift in Sources */, + 6225FCCB2663841E00E067F6 /* ParallaxHeader.swift in Sources */, 53F8377D265FF67C00F456B3 /* VideoPlayerSettingsView.swift in Sources */, 53987CA426572C1300E7EA70 /* SeasonItemView.swift in Sources */, 53192D5D265AA78A008A4215 /* DeviceProfileBuilder.swift in Sources */, @@ -559,7 +571,8 @@ 621338B32660A07800A81A2A /* LazyView.swift in Sources */, 62133895266096EF00A81A2A /* LibraryListViewModel.swift in Sources */, 535870AD2669D8DD00D05A09 /* Typings.swift in Sources */, - 6273DD48265F41B3009C1D0B /* JellyfinAPI.swift in Sources */, + 6273DD48265F41B3009C1D0B /* JellyfinAPIOld.swift in Sources */, + 53C4404E266C75C70049424C /* HandleAPIRequestCompletion.swift in Sources */, 53892777263CBB000035E14B /* JellyApiTypings.swift in Sources */, 5377CBF7263B596A003A4E83 /* ContentView.swift in Sources */, 53987CA82657424A00E7EA70 /* EpisodeItemView.swift in Sources */, @@ -596,7 +609,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "me.vigue.JellyfinPlayer-tvOS"; + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = me.vigue.swiftfin.tv; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_VERSION = 5.0; @@ -623,7 +637,8 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "me.vigue.JellyfinPlayer-tvOS"; + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = me.vigue.swiftfin.tv; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_VERSION = 5.0; @@ -756,6 +771,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = JellyfinPlayer/JellyfinPlayer.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 33; DEVELOPMENT_ASSET_PATHS = ""; @@ -772,6 +788,8 @@ MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = me.vigue.jellyfin; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -782,6 +800,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = JellyfinPlayer/JellyfinPlayer.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 33; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -799,6 +818,8 @@ MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = me.vigue.jellyfin; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -869,6 +890,14 @@ minimumVersion = 5.0.1; }; }; + 53A431BB266B0FF20016769F /* XCRemoteSwiftPackageReference "jellyfin-sdk-swift" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/jellyfin/jellyfin-sdk-swift"; + requirement = { + branch = main; + kind = branch; + }; + }; 621C637E26672A30004216EA /* XCRemoteSwiftPackageReference "NukeUI" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kean/NukeUI"; @@ -953,6 +982,16 @@ package = 53892778263CBFE70035E14B /* XCRemoteSwiftPackageReference "SwiftyJSON" */; productName = SwiftyJSON; }; + 53A431BC266B0FF20016769F /* JellyfinAPI */ = { + isa = XCSwiftPackageProductDependency; + package = 53A431BB266B0FF20016769F /* XCRemoteSwiftPackageReference "jellyfin-sdk-swift" */; + productName = JellyfinAPI; + }; + 53A431BE266B0FFE0016769F /* JellyfinAPI */ = { + isa = XCSwiftPackageProductDependency; + package = 53A431BB266B0FF20016769F /* XCRemoteSwiftPackageReference "jellyfin-sdk-swift" */; + productName = JellyfinAPI; + }; 621C637F26672A30004216EA /* NukeUI */ = { isa = XCSwiftPackageProductDependency; package = 621C637E26672A30004216EA /* XCRemoteSwiftPackageReference "NukeUI" */; diff --git a/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index c3a6e063..729c4dbf 100644 --- a/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -10,6 +10,15 @@ "version": "5.4.3" } }, + { + "package": "AnyCodable", + "repositoryURL": "https://github.com/Flight-School/AnyCodable", + "state": { + "branch": null, + "revision": "876d162385e9862ae8b3c8d65dc301312b040005", + "version": "0.6.0" + } + }, { "package": "async-http-client", "repositoryURL": "https://github.com/swift-server/async-http-client.git", @@ -37,6 +46,15 @@ "version": "3.3.0" } }, + { + "package": "JellyfinAPI", + "repositoryURL": "https://github.com/jellyfin/jellyfin-sdk-swift", + "state": { + "branch": "main", + "revision": "02fe19f44738341aa2ad7d9452f74ad3464a639d", + "version": null + } + }, { "package": "KeychainSwift", "repositoryURL": "https://github.com/evgenyneu/keychain-swift", diff --git a/JellyfinPlayer.xcodeproj/xcshareddata/IDETemplateMacros.plist b/JellyfinPlayer.xcodeproj/xcshareddata/IDETemplateMacros.plist new file mode 100644 index 00000000..051abdf3 --- /dev/null +++ b/JellyfinPlayer.xcodeproj/xcshareddata/IDETemplateMacros.plist @@ -0,0 +1,13 @@ + + + + + FILEHEADER + /* 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 + */ + + diff --git a/JellyfinPlayer/APIs/JellyApiTypings.swift b/JellyfinPlayer/APIs/JellyApiTypings.swift index 9d584c7a..42e251bc 100644 --- a/JellyfinPlayer/APIs/JellyApiTypings.swift +++ b/JellyfinPlayer/APIs/JellyApiTypings.swift @@ -1,9 +1,9 @@ -// -// JellyApiTypings.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/30/21. -// +/* 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 Foundation import SwiftUI diff --git a/JellyfinPlayer/APIs/JellyfinAPI.swift b/JellyfinPlayer/APIs/JellyfinAPIOld.swift similarity index 92% rename from JellyfinPlayer/APIs/JellyfinAPI.swift rename to JellyfinPlayer/APIs/JellyfinAPIOld.swift index 3a9fa572..258824de 100644 --- a/JellyfinPlayer/APIs/JellyfinAPI.swift +++ b/JellyfinPlayer/APIs/JellyfinAPIOld.swift @@ -1,9 +1,9 @@ -// -// JellyfinAPI.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/27. -// +/* 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 Foundation import Moya @@ -77,12 +77,12 @@ extension Filter { } } -enum JellyfinAPI { +enum JellyfinAPIOld { case items(globalData: GlobalData, filter: Filter, page: Int) case search(globalData: GlobalData, filter: Filter, searchQuery: String, page: Int) } -extension JellyfinAPI: TargetType { +extension JellyfinAPIOld: TargetType { var baseURL: URL { switch self { diff --git a/JellyfinPlayer/Assets.xcassets/Color-1.colorset/Contents.json b/JellyfinPlayer/Assets.xcassets/Color-1.colorset/Contents.json deleted file mode 100644 index 88fe200a..00000000 --- a/JellyfinPlayer/Assets.xcassets/Color-1.colorset/Contents.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "1.000", - "green" : "1.000", - "red" : "1.000" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/JellyfinPlayer/ConnectToServerView.swift b/JellyfinPlayer/ConnectToServerView.swift index 9b312dba..1fe8f440 100644 --- a/JellyfinPlayer/ConnectToServerView.swift +++ b/JellyfinPlayer/ConnectToServerView.swift @@ -1,9 +1,9 @@ -// -// ConnectToServerView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/29/21. -// +/* 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 SwiftUI @@ -12,6 +12,7 @@ import SwiftyJSON import CoreData import KeychainSwift import NukeUI +import JellyfinAPI class publicUser: ObservableObject { @Published var username: String = ""; @@ -102,10 +103,12 @@ struct ConnectToServerView: View { func doLogin() { _isWorking.wrappedValue = true - let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String; - let authHeader = "MediaBrowser Client=\"SwiftFin\", Device=\"\(UIDevice.current.name)\", DeviceId=\"\(serverSkipped ? reauthDeviceID : userUUID.uuidString)\", Version=\"\(appVersion ?? "0.0.1")\""; let authJson: [String: Any] = ["Username": _username.wrappedValue, "Pw": _password.wrappedValue] let request = RestRequest(method: .post, url: uri + "/Users/authenticatebyname") + + let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String; + let authHeader = "MediaBrowser Client=\"SwiftFin\", Device=\"\(UIDevice.current.name)\", DeviceId=\"\(serverSkipped ? reauthDeviceID : userUUID.uuidString)\", Version=\"\(appVersion ?? "0.0.1")\""; + request.headerParameters["X-Emby-Authorization"] = authHeader request.contentType = "application/json" request.acceptType = "application/json" diff --git a/JellyfinPlayer/ContentView.swift b/JellyfinPlayer/ContentView.swift index c58bb4df..39d16f0e 100644 --- a/JellyfinPlayer/ContentView.swift +++ b/JellyfinPlayer/ContentView.swift @@ -1,9 +1,9 @@ -// -// ContentView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/29/21. -// +/* 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 SwiftUI @@ -11,6 +11,8 @@ import KeychainSwift import SwiftyJSON import SwiftyRequest import Nuke +import Combine +import JellyfinAPI struct ContentView: View { @Environment(\.managedObjectContext) @@ -34,10 +36,6 @@ struct ContentView: View { @State private var needsToSelectServer = false @State - private var isSignInErrored = false - @State - private var isNetworkErrored = false - @State private var isLoading = false @State private var tabSelection: String = "Home" @@ -62,136 +60,91 @@ struct ContentView: View { orientationInfo.orientation = .landscape } - if _viewDidLoad.wrappedValue { + if viewDidLoad { return } - _viewDidLoad.wrappedValue = true + viewDidLoad = true ImageCache.shared.costLimit = 125 * 1024 * 1024 // 125MB memory DataLoader.sharedUrlCache.diskCapacity = 1000 * 1024 * 1024 // 1000MB disk - _libraries.wrappedValue = [] - _library_names.wrappedValue = [:] - _librariesShowRecentlyAdded.wrappedValue = [] if servers.isEmpty { - _isLoading.wrappedValue = false - _needsToSelectServer.wrappedValue = true + isLoading = false + needsToSelectServer = true } else { - _isLoading.wrappedValue = true + isLoading = true let savedUser = savedUsers[0] let keychain = KeychainSwift() if keychain.get("AccessToken_\(savedUser.user_id ?? "")") != nil { - _globalData.wrappedValue.authToken = keychain.get("AccessToken_\(savedUser.user_id ?? "")") ?? "" - _globalData.wrappedValue.server = servers[0] - _globalData.wrappedValue.user = savedUser + globalData.authToken = keychain.get("AccessToken_\(savedUser.user_id ?? "")") ?? "" + globalData.server = servers[0] + globalData.user = savedUser } let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String var deviceName = UIDevice.current.name; deviceName = deviceName.folding(options: .diacriticInsensitive, locale: .current) deviceName = deviceName.removeRegexMatches(pattern: "[^\\w\\s]"); + var header = "MediaBrowser " - header.append("Client=\"SwiftFin\",") - header.append("Device=\"\(deviceName)\",") - header.append("DeviceId=\"\(globalData.user?.device_uuid ?? "")\",") - header.append("Version=\"\(appVersion ?? "0.0.1")\",") + header.append("Client=\"SwiftFin\", ") + header.append("Device=\"\(deviceName)\", ") + header.append("DeviceId=\"\(globalData.user?.device_uuid ?? "")\", ") + header.append("Version=\"\(appVersion ?? "0.0.1")\", ") header.append("Token=\"\(globalData.authToken)\"") + globalData.authHeader = header - - let request = RestRequest(method: .get, url: (globalData.server?.baseURI ?? "") + "/Users/Me") - request.headerParameters["X-Emby-Authorization"] = globalData.authHeader - request.contentType = "application/json" - request.acceptType = "application/json" - - request.responseData { (result: Result, RestError>) in - switch result { - case let .success(resp): - do { - let json = try JSON(data: resp.body) - let array2 = json["Configuration"]["LatestItemsExcludes"].arrayObject as? [String] ?? [] - - let request2 = RestRequest(method: .get, - url: (globalData.server?.baseURI ?? "") + - "/Users/\(globalData.user?.user_id ?? "")/Views") - request2.headerParameters["X-Emby-Authorization"] = globalData.authHeader - request2.contentType = "application/json" - request2.acceptType = "application/json" - - request2.responseData { (result2: Result, RestError>) in - switch result2 { - case let .success(resp): - do { - let json2 = try JSON(data: resp.body) - for (_, item2): (String, JSON) in json2["Items"] { - _library_names.wrappedValue[item2["Id"].string ?? ""] = item2["Name"].string ?? "" - } - - for (_, item2): (String, JSON) in json2["Items"] { - if item2["CollectionType"].string == "tvshows" || item2["CollectionType"].string == "movies" { - _libraries.wrappedValue.append(item2["Id"].string ?? "") - _librariesShowRecentlyAdded.wrappedValue.append(item2["Id"].string ?? "") - } - } - - _librariesShowRecentlyAdded.wrappedValue = _libraries.wrappedValue.filter { element in - !array2.contains(element) - } - - _libraries.wrappedValue.forEach { library in - if _library_names.wrappedValue[library] == nil { - _libraries.wrappedValue.removeAll { ele in - if library == ele { - return true - } else { - return false - } - } - } - } - - dump(_libraries.wrappedValue) - dump(_librariesShowRecentlyAdded.wrappedValue) - dump(_library_names.wrappedValue) - } catch {} - case .failure(_): - break - } - let defaults = UserDefaults.standard - if defaults.integer(forKey: "InNetworkBandwidth") == 0 { - defaults.setValue(40_000_000, forKey: "InNetworkBandwidth") - } - if defaults.integer(forKey: "OutOfNetworkBandwidth") == 0 { - defaults.setValue(40_000_000, forKey: "OutOfNetworkBandwidth") - } - _isLoading.wrappedValue = false - } - } catch {} - case let .failure(error): - if error.response?.status.code == 401 { - _isLoading.wrappedValue = false - _isSignInErrored.wrappedValue = true - } else { - _isLoading.wrappedValue = false - _isNetworkErrored.wrappedValue = true + JellyfinAPI.basePath = globalData.server?.baseURI ?? "" + JellyfinAPI.customHeaders = ["X-Emby-Authorization": globalData.authHeader] + + UserAPI.getCurrentUser() + .sink(receiveCompletion: { completion in + HandleAPIRequestCompletion(globalData: globalData, completion: completion) + }, receiveValue: { response in + //Get all libraries + libraries = response.configuration?.orderedViews ?? [] + librariesShowRecentlyAdded = libraries.filter { element in + return !(response.configuration?.latestItemsExcludes?.contains(element))! } - } + }) + .store(in: &globalData.pendingAPIRequests) + + UserViewsAPI.getUserViews(userId: globalData.user?.user_id ?? "") + .sink(receiveCompletion: { completion in + HandleAPIRequestCompletion(globalData: globalData, completion: completion) + }, receiveValue: { response in + //Get all libraries + response.items?.forEach({ item in + library_names[item.id ?? ""] = item.name + }) + }) + .store(in: &globalData.pendingAPIRequests) + + let defaults = UserDefaults.standard + if defaults.integer(forKey: "InNetworkBandwidth") == 0 { + defaults.setValue(40_000_000, forKey: "InNetworkBandwidth") } + if defaults.integer(forKey: "OutOfNetworkBandwidth") == 0 { + defaults.setValue(40_000_000, forKey: "OutOfNetworkBandwidth") + } + + isLoading = false } } var body: some View { - if needsToSelectServer { + if (needsToSelectServer == true) { NavigationView { ConnectToServerView(isActive: $needsToSelectServer) } .navigationViewStyle(StackNavigationViewStyle()) .environmentObject(globalData) - } else if isSignInErrored { + } else if (globalData.expiredCredentials == true) { NavigationView { ConnectToServerView(skip_server: true, skip_server_prefill: globalData.server, - reauth_deviceId: globalData.user?.device_uuid ?? "", isActive: $isSignInErrored) + reauth_deviceId: globalData.user?.device_uuid ?? "", isActive: $globalData.expiredCredentials) } .navigationViewStyle(StackNavigationViewStyle()) .environmentObject(globalData) @@ -257,7 +210,7 @@ struct ContentView: View { } .environmentObject(globalData) .onAppear(perform: startup) - .alert(isPresented: $isNetworkErrored) { + .alert(isPresented: $globalData.networkError) { Alert(title: Text("Network Error"), message: Text("Couldn't connect to Jellyfin"), dismissButton: .default(Text("Ok"))) } } else { diff --git a/JellyfinPlayer/ContinueWatchingView.swift b/JellyfinPlayer/ContinueWatchingView.swift index 8b6be46c..d9100f54 100644 --- a/JellyfinPlayer/ContinueWatchingView.swift +++ b/JellyfinPlayer/ContinueWatchingView.swift @@ -1,9 +1,9 @@ -// -// NextUpView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/30/21. -// +/* 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 SwiftUI import SwiftyRequest @@ -179,9 +179,3 @@ struct ContinueWatchingView: View { .padding(.bottom, 10) } } - -struct ContinueWatchingView_Previews: PreviewProvider { - static var previews: some View { - ContinueWatchingView() - } -} diff --git a/JellyfinPlayer/DeviceProfileBuilder.swift b/JellyfinPlayer/DeviceProfileBuilder.swift index 6082ee3e..09000619 100644 --- a/JellyfinPlayer/DeviceProfileBuilder.swift +++ b/JellyfinPlayer/DeviceProfileBuilder.swift @@ -1,9 +1,9 @@ -// -// DeviceProfileBuilder.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/23/21. -// +/* 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 + */ //lol can someone buy me a coffee this took forever :| diff --git a/JellyfinPlayer/EpisodeItemView.swift b/JellyfinPlayer/EpisodeItemView.swift index 467f8666..babb493d 100644 --- a/JellyfinPlayer/EpisodeItemView.swift +++ b/JellyfinPlayer/EpisodeItemView.swift @@ -1,9 +1,9 @@ -// -// EpisodeItemView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/13/21. -// +/* 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 SwiftUI import SwiftyJSON diff --git a/JellyfinPlayer/Extensions/LazyView.swift b/JellyfinPlayer/Extensions/LazyView.swift deleted file mode 100644 index b0f5630f..00000000 --- a/JellyfinPlayer/Extensions/LazyView.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// LazyView.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/28. -// - -import Foundation -import SwiftUI - -struct LazyView: View { - var content: () -> Content - var body: some View { - self.content() - } -} diff --git a/JellyfinPlayer/ItemView.swift b/JellyfinPlayer/ItemView.swift index 4044c792..877eead7 100644 --- a/JellyfinPlayer/ItemView.swift +++ b/JellyfinPlayer/ItemView.swift @@ -1,9 +1,9 @@ -// -// ItemView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/10/21. -// +/* 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 SwiftUI import Introspect diff --git a/JellyfinPlayer/JellyfinPlayer.entitlements b/JellyfinPlayer/JellyfinPlayer.entitlements new file mode 100644 index 00000000..ee95ab7e --- /dev/null +++ b/JellyfinPlayer/JellyfinPlayer.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/JellyfinPlayer/JellyfinPlayerApp.swift b/JellyfinPlayer/JellyfinPlayerApp.swift index 0214163e..e038ec1e 100644 --- a/JellyfinPlayer/JellyfinPlayerApp.swift +++ b/JellyfinPlayer/JellyfinPlayerApp.swift @@ -1,9 +1,9 @@ -// -// JellyfinPlayerApp.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/29/21. -// +/* 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 SwiftUI diff --git a/JellyfinPlayer/LatestMediaView.swift b/JellyfinPlayer/LatestMediaView.swift index 88004fdc..cc11808f 100644 --- a/JellyfinPlayer/LatestMediaView.swift +++ b/JellyfinPlayer/LatestMediaView.swift @@ -1,9 +1,9 @@ -// -// LatestMediaView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/30/21. -// +/* 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 SwiftUI import SwiftyRequest diff --git a/JellyfinPlayer/LibraryFilterView.swift b/JellyfinPlayer/LibraryFilterView.swift index 43aa3f4b..27ec9e03 100644 --- a/JellyfinPlayer/LibraryFilterView.swift +++ b/JellyfinPlayer/LibraryFilterView.swift @@ -1,9 +1,9 @@ -// -// LibraryFilterView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/2/21. -// +/* 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 SwiftUI import SwiftyJSON diff --git a/JellyfinPlayer/LibraryListView.swift b/JellyfinPlayer/LibraryListView.swift index ffe48591..776eb428 100644 --- a/JellyfinPlayer/LibraryListView.swift +++ b/JellyfinPlayer/LibraryListView.swift @@ -1,9 +1,9 @@ -// -// LibraryListView.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/27. -// +/* 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 Foundation import SwiftUI diff --git a/JellyfinPlayer/LibrarySearchView.swift b/JellyfinPlayer/LibrarySearchView.swift index 0fb7ae20..8fa4ecf2 100644 --- a/JellyfinPlayer/LibrarySearchView.swift +++ b/JellyfinPlayer/LibrarySearchView.swift @@ -1,9 +1,9 @@ -// -// LibrarySearchView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/2/21. -// +/* 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 SwiftUI import SwiftyJSON diff --git a/JellyfinPlayer/LibraryView.swift b/JellyfinPlayer/LibraryView.swift index 9823aeb0..d4a103ce 100644 --- a/JellyfinPlayer/LibraryView.swift +++ b/JellyfinPlayer/LibraryView.swift @@ -1,9 +1,9 @@ -// -// LibraryView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/1/21. -// +/* 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 SwiftUI import NukeUI diff --git a/JellyfinPlayer/Models/SettingsModel.swift b/JellyfinPlayer/Models/SettingsModel.swift index 41155dde..a0622bf9 100644 --- a/JellyfinPlayer/Models/SettingsModel.swift +++ b/JellyfinPlayer/Models/SettingsModel.swift @@ -1,9 +1,9 @@ -// -// SettingsModel.swift -// JellyfinPlayer -// -// Created by Julien Machiels on 25/05/2021. -// +/* 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 Foundation diff --git a/JellyfinPlayer/MovieItemView.swift b/JellyfinPlayer/MovieItemView.swift index 55c0b7c6..b41b01f2 100644 --- a/JellyfinPlayer/MovieItemView.swift +++ b/JellyfinPlayer/MovieItemView.swift @@ -1,9 +1,9 @@ -// -// MovieItemView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/13/21. -// +/* 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 SwiftUI import SwiftyJSON diff --git a/JellyfinPlayer/NextUpView.swift b/JellyfinPlayer/NextUpView.swift index 23e08323..d85f3d8d 100644 --- a/JellyfinPlayer/NextUpView.swift +++ b/JellyfinPlayer/NextUpView.swift @@ -1,9 +1,9 @@ -// -// NextUpView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/30/21. -// +/* 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 SwiftUI import SwiftyRequest diff --git a/JellyfinPlayer/PersistenceController.swift b/JellyfinPlayer/PersistenceController.swift index 8f179c60..9edec083 100644 --- a/JellyfinPlayer/PersistenceController.swift +++ b/JellyfinPlayer/PersistenceController.swift @@ -1,9 +1,9 @@ -// -// Persistence.swift -// JFPlayer -// -// Created by Aiden Vigue on 4/29/21. -// +/* 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 CoreData diff --git a/JellyfinPlayer/SeasonItemView.swift b/JellyfinPlayer/SeasonItemView.swift index 0931a379..410e411b 100644 --- a/JellyfinPlayer/SeasonItemView.swift +++ b/JellyfinPlayer/SeasonItemView.swift @@ -1,9 +1,9 @@ -// -// SeasonItemView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/13/21. -// +/* 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 NukeUI import SwiftUI diff --git a/JellyfinPlayer/SeriesItemView.swift b/JellyfinPlayer/SeriesItemView.swift index c4ccb14f..3d9b9e35 100644 --- a/JellyfinPlayer/SeriesItemView.swift +++ b/JellyfinPlayer/SeriesItemView.swift @@ -1,9 +1,9 @@ -// -// SeriesItemView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/1/21. -// +/* 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 SwiftUI import SwiftyRequest diff --git a/JellyfinPlayer/ViewModels/LibraryListViewModel.swift b/JellyfinPlayer/ViewModels/LibraryListViewModel.swift index 875c2125..62d724ba 100644 --- a/JellyfinPlayer/ViewModels/LibraryListViewModel.swift +++ b/JellyfinPlayer/ViewModels/LibraryListViewModel.swift @@ -1,9 +1,9 @@ -// -// LibraryListViewModel.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/28. -// +/* 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 Combine import CombineMoya @@ -13,7 +13,7 @@ import SwiftyJSON final class LibraryListViewModel: ObservableObject { fileprivate var provider = - MoyaProvider() + MoyaProvider() @Published var libraryIDs = [String]() diff --git a/JellyfinPlayer/ViewModels/LibrarySearchViewModel.swift b/JellyfinPlayer/ViewModels/LibrarySearchViewModel.swift index ecfe6016..459ca373 100644 --- a/JellyfinPlayer/ViewModels/LibrarySearchViewModel.swift +++ b/JellyfinPlayer/ViewModels/LibrarySearchViewModel.swift @@ -1,9 +1,9 @@ -// -// LibrarySearchViewModel.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/27. -// +/* 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 Combine import CombineMoya @@ -12,7 +12,7 @@ import Moya import SwiftyJSON final class LibrarySearchViewModel: ObservableObject { - fileprivate var provider = MoyaProvider() + fileprivate var provider = MoyaProvider() var filter: Filter diff --git a/JellyfinPlayer/ViewModels/LibraryViewModel.swift b/JellyfinPlayer/ViewModels/LibraryViewModel.swift index d616ae24..c3285f66 100644 --- a/JellyfinPlayer/ViewModels/LibraryViewModel.swift +++ b/JellyfinPlayer/ViewModels/LibraryViewModel.swift @@ -1,9 +1,9 @@ -// -// LibraryViewModel.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/27. -// +/* 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 Combine import CombineMoya @@ -13,7 +13,7 @@ import SwiftyJSON final class LibraryViewModel: ObservableObject { fileprivate var provider = - MoyaProvider() + MoyaProvider() @Published var filter: Filter diff --git a/JellyfinPlayer/ViewModels/SettingsViewModel.swift b/JellyfinPlayer/ViewModels/SettingsViewModel.swift index 288eae87..2af7f237 100644 --- a/JellyfinPlayer/ViewModels/SettingsViewModel.swift +++ b/JellyfinPlayer/ViewModels/SettingsViewModel.swift @@ -1,9 +1,9 @@ -// -// SettingsViewModel.swift -// JellyfinPlayer -// -// Created by Julien Machiels on 25/05/2021. -// +/* 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 Foundation diff --git a/JellyfinPlayer/Views/LoadingView.swift b/JellyfinPlayer/Views/LoadingView.swift index 820eef35..3f1449c8 100644 --- a/JellyfinPlayer/Views/LoadingView.swift +++ b/JellyfinPlayer/Views/LoadingView.swift @@ -1,3 +1,10 @@ +/* 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 SwiftUI struct LoadingView: View where Content: View { diff --git a/JellyfinPlayer/Views/SettingsView.swift b/JellyfinPlayer/Views/SettingsView.swift index e619d2a4..ca1afece 100644 --- a/JellyfinPlayer/Views/SettingsView.swift +++ b/JellyfinPlayer/Views/SettingsView.swift @@ -1,9 +1,9 @@ -// -// SettingsView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 4/29/21. -// +/* 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 CoreData import SwiftUI diff --git a/JellyfinPlayer/Views/VideoPlayer.swift b/JellyfinPlayer/Views/VideoPlayer.swift index 358bd52f..e8fbf8d5 100644 --- a/JellyfinPlayer/Views/VideoPlayer.swift +++ b/JellyfinPlayer/Views/VideoPlayer.swift @@ -1,9 +1,9 @@ -// -// VideoPlayer.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/26/21. -// +/* 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 SwiftUI import MobileVLCKit diff --git a/JellyfinPlayer/Views/VideoPlayerSettingsView.swift b/JellyfinPlayer/Views/VideoPlayerSettingsView.swift index f3906ec8..9efb3050 100644 --- a/JellyfinPlayer/Views/VideoPlayerSettingsView.swift +++ b/JellyfinPlayer/Views/VideoPlayerSettingsView.swift @@ -1,9 +1,9 @@ -// -// VideoPlayerSettingsView.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/27/21. -// +/* 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 Foundation import SwiftUI diff --git a/JellyfinPlayer/Extensions/BlurHashDecode.swift b/Shared/Extensions/BlurHashDecode.swift similarity index 82% rename from JellyfinPlayer/Extensions/BlurHashDecode.swift rename to Shared/Extensions/BlurHashDecode.swift index aa942224..867f8a84 100644 --- a/JellyfinPlayer/Extensions/BlurHashDecode.swift +++ b/Shared/Extensions/BlurHashDecode.swift @@ -1,3 +1,25 @@ +/* + Copyright (c) 2018 Wolt Enterprises + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + import UIKit extension UIImage { diff --git a/Shared/Extensions/HandleAPIRequestCompletion.swift b/Shared/Extensions/HandleAPIRequestCompletion.swift new file mode 100644 index 00000000..5e522912 --- /dev/null +++ b/Shared/Extensions/HandleAPIRequestCompletion.swift @@ -0,0 +1,27 @@ +/* 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 Foundation +import Combine +import JellyfinAPI + +func HandleAPIRequestCompletion(globalData: GlobalData, completion: Subscribers.Completion) { + switch completion { + case .finished: + break + case .failure(let error): + if let err = error as? ErrorResponse { + switch(err){ + case .error(401, _, _, _): + globalData.expiredCredentials = true; + case .error(_, _, _, _): + globalData.networkError = true; + } + } + break + } +} diff --git a/JellyfinPlayer/Extensions/LazyImage++.swift b/Shared/Extensions/LazyImage.swift similarity index 52% rename from JellyfinPlayer/Extensions/LazyImage++.swift rename to Shared/Extensions/LazyImage.swift index d124f6a7..da37c432 100644 --- a/JellyfinPlayer/Extensions/LazyImage++.swift +++ b/Shared/Extensions/LazyImage.swift @@ -1,9 +1,9 @@ -// -// LazyImage++.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/06/02. -// +/* 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 Foundation import SwiftUI diff --git a/Shared/Extensions/LazyView.swift b/Shared/Extensions/LazyView.swift new file mode 100644 index 00000000..af46b7f0 --- /dev/null +++ b/Shared/Extensions/LazyView.swift @@ -0,0 +1,16 @@ +/* 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 Foundation +import SwiftUI + +struct LazyView: View { + var content: () -> Content + var body: some View { + self.content() + } +} diff --git a/JellyfinPlayer/Extensions/MultiSelector.swift b/Shared/Extensions/MultiSelector.swift similarity index 88% rename from JellyfinPlayer/Extensions/MultiSelector.swift rename to Shared/Extensions/MultiSelector.swift index 2d4b7a61..6746a107 100644 --- a/JellyfinPlayer/Extensions/MultiSelector.swift +++ b/Shared/Extensions/MultiSelector.swift @@ -1,9 +1,9 @@ -// -// MultiSelector.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 5/2/21. -// +/* 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 SwiftUI diff --git a/JellyfinPlayer/Extensions/ParallaxHeaderScrollView.swift b/Shared/Extensions/ParallaxHeader.swift similarity index 82% rename from JellyfinPlayer/Extensions/ParallaxHeaderScrollView.swift rename to Shared/Extensions/ParallaxHeader.swift index 1c57ffe8..ab705b99 100644 --- a/JellyfinPlayer/Extensions/ParallaxHeaderScrollView.swift +++ b/Shared/Extensions/ParallaxHeader.swift @@ -1,9 +1,9 @@ -// -// ParallaxHeaderScrollView.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/30. -// +/* 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 Foundation import SwiftUI diff --git a/JellyfinPlayer/Extensions/String++.swift b/Shared/Extensions/String.swift similarity index 62% rename from JellyfinPlayer/Extensions/String++.swift rename to Shared/Extensions/String.swift index dfbddfe7..3e0797c0 100644 --- a/JellyfinPlayer/Extensions/String++.swift +++ b/Shared/Extensions/String.swift @@ -1,9 +1,9 @@ -// -// String++.swift -// JellyfinPlayer -// -// Created by PangMo5 on 2021/05/28. -// +/* 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 Foundation diff --git a/Shared/Typings/Typings.swift b/Shared/Typings/Typings.swift index df373ec4..bfdde290 100644 --- a/Shared/Typings/Typings.swift +++ b/Shared/Typings/Typings.swift @@ -1,11 +1,12 @@ -// -// Typings.swift -// JellyfinPlayer -// -// Created by Aiden Vigue on 6/3/21. -// +/* 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 Foundation +import Combine class justSignedIn: ObservableObject { @Published var did: Bool = false @@ -17,6 +18,9 @@ class GlobalData: ObservableObject { @Published var server: Server? @Published var authHeader: String = "" @Published var isInNetwork: Bool = true; + @Published var networkError: Bool = false; + @Published var expiredCredentials: Bool = false; + @Published var pendingAPIRequests = Set(); } extension GlobalData: Equatable {