license headers - start switch to combine api

This commit is contained in:
Aiden Vigue 2021-06-05 22:57:25 -07:00
parent 6e3e60cae1
commit f27574f94d
46 changed files with 459 additions and 396 deletions

View File

@ -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

View File

@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Jellyfin</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@ -15,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>

View File

@ -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

View File

@ -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

View File

@ -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 = "<group>"; };
53313B8F265EEA6D00947AA3 /* VideoPlayer.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = VideoPlayer.storyboard; sourceTree = "<group>"; };
5333A68A266BDDC10044FD6B /* JellyfinPlayer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = JellyfinPlayer.entitlements; sourceTree = "<group>"; };
5338F74D263B61370014BF09 /* ConnectToServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectToServerView.swift; sourceTree = "<group>"; };
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 = "<group>"; };
@ -152,6 +156,7 @@
53987CA72657424A00E7EA70 /* EpisodeItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeItemView.swift; sourceTree = "<group>"; };
539B2DA4263BA5B8007FF1A4 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
53A089CF264DA9DA00D57806 /* MovieItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieItemView.swift; sourceTree = "<group>"; };
53C4404D266C75C70049424C /* HandleAPIRequestCompletion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandleAPIRequestCompletion.swift; sourceTree = "<group>"; };
53D5E3DA264B460200BADDC8 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = "<group>"; };
53D5E3DC264B47EE00BADDC8 /* MobileVLCKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MobileVLCKit.xcframework; path = Carthage/Build/MobileVLCKit.xcframework; sourceTree = "<group>"; };
53DF641D263D9C0600A7CD1A /* LibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryView.swift; sourceTree = "<group>"; };
@ -162,12 +167,12 @@
53FF7F29263CF3F500585C35 /* LatestMediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LatestMediaView.swift; sourceTree = "<group>"; };
6213388D265F777C00A81A2A /* LibraryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryViewModel.swift; sourceTree = "<group>"; };
6213388F265F83A900A81A2A /* LibraryListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListView.swift; sourceTree = "<group>"; };
621338922660107500A81A2A /* String++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String++.swift"; sourceTree = "<group>"; };
621338922660107500A81A2A /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
62133894266096EF00A81A2A /* LibraryListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListViewModel.swift; sourceTree = "<group>"; };
621338B22660A07800A81A2A /* LazyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LazyView.swift; sourceTree = "<group>"; };
621C638126676728004216EA /* LazyImage++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LazyImage++.swift"; sourceTree = "<group>"; };
6225FCCA2663841E00E067F6 /* ParallaxHeaderScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallaxHeaderScrollView.swift; sourceTree = "<group>"; };
6273DD47265F41B3009C1D0B /* JellyfinAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JellyfinAPI.swift; sourceTree = "<group>"; };
621C638126676728004216EA /* LazyImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LazyImage.swift; sourceTree = "<group>"; };
6225FCCA2663841E00E067F6 /* ParallaxHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallaxHeader.swift; sourceTree = "<group>"; };
6273DD47265F41B3009C1D0B /* JellyfinAPIOld.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JellyfinAPIOld.swift; sourceTree = "<group>"; };
6273DD4D265F47B2009C1D0B /* LibrarySearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrarySearchViewModel.swift; sourceTree = "<group>"; };
AE8C3153265D60BF008AA076 /* SettingsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsModel.swift; sourceTree = "<group>"; };
AE8C3155265D616A008AA076 /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = "<group>"; };
@ -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 = "<group>";
@ -336,7 +345,7 @@
isa = PBXGroup;
children = (
53892776263CBB000035E14B /* JellyApiTypings.swift */,
6273DD47265F41B3009C1D0B /* JellyfinAPI.swift */,
6273DD47265F41B3009C1D0B /* JellyfinAPIOld.swift */,
);
path = APIs;
sourceTree = "<group>";
@ -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" */;

View File

@ -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",

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>/* 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 &amp; Jellyfin Contributors
*/</string>
</dict>
</plist>

View File

@ -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

View File

@ -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 {

View File

@ -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
}
}

View File

@ -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"

View File

@ -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<RestResponse<Data>, 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<RestResponse<Data>, 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 {

View File

@ -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()
}
}

View File

@ -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 :|

View File

@ -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

View File

@ -1,16 +0,0 @@
//
// LazyView.swift
// JellyfinPlayer
//
// Created by PangMo5 on 2021/05/28.
//
import Foundation
import SwiftUI
struct LazyView<Content: View>: View {
var content: () -> Content
var body: some View {
self.content()
}
}

View File

@ -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

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<JellyfinAPI>()
MoyaProvider<JellyfinAPIOld>()
@Published
var libraryIDs = [String]()

View File

@ -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<JellyfinAPI>()
fileprivate var provider = MoyaProvider<JellyfinAPIOld>()
var filter: Filter

View File

@ -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<JellyfinAPI>()
MoyaProvider<JellyfinAPIOld>()
@Published
var filter: Filter

View File

@ -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

View File

@ -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<Content>: View where Content: View {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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<Error>) {
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
}
}

View File

@ -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

View File

@ -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<Content: View>: View {
var content: () -> Content
var body: some View {
self.content()
}
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<AnyCancellable>();
}
extension GlobalData: Equatable {