diff --git a/JellyfinPlayer tvOS/Components/LandscapeItemElement.swift b/JellyfinPlayer tvOS/Components/LandscapeItemElement.swift index 191545fa..cb2a5c6a 100644 --- a/JellyfinPlayer tvOS/Components/LandscapeItemElement.swift +++ b/JellyfinPlayer tvOS/Components/LandscapeItemElement.swift @@ -92,13 +92,13 @@ struct LandscapeItemElement: View { .shadow(radius: focused ? 10.0 : 0, y: focused ? 10.0 : 0) if focused { if inSeasonView ?? false { - Text("\(item.getEpisodeLocator()) • \(item.name ?? "")") + Text("\(item.getEpisodeLocator() ?? "") • \(item.name ?? "")") .font(.callout) .fontWeight(.semibold) .lineLimit(1) .frame(width: 445) } else { - Text(item.type == "Episode" ? "\(item.seriesName ?? "") • \(item.getEpisodeLocator())" : item.name ?? "") + Text(item.type == "Episode" ? "\(item.seriesName ?? "") • \(item.getEpisodeLocator() ?? "")" : item.name ?? "") .font(.callout) .fontWeight(.semibold) .lineLimit(1) diff --git a/JellyfinPlayer tvOS/MainTabView.swift b/JellyfinPlayer tvOS/MainTabView.swift index f033827d..5624f164 100644 --- a/JellyfinPlayer tvOS/MainTabView.swift +++ b/JellyfinPlayer tvOS/MainTabView.swift @@ -46,7 +46,7 @@ struct MainTabView: View { Image(systemName: "house") } - .tag(Tab.allMedia) + .tag(Tab.home) Text("Library") .tabItem { diff --git a/JellyfinPlayer tvOS/SeriesItemView.swift b/JellyfinPlayer tvOS/SeriesItemView.swift index 72fee560..c0d2781d 100644 --- a/JellyfinPlayer tvOS/SeriesItemView.swift +++ b/JellyfinPlayer tvOS/SeriesItemView.swift @@ -53,11 +53,7 @@ struct SeriesItemView: View { .fontWeight(.bold) .foregroundColor(.primary) HStack { - Text(viewModel.getRunYears()).font(.subheadline) - .fontWeight(.medium) - .foregroundColor(.secondary) - .lineLimit(1) - if viewModel.item.officialRating != nil { + if viewModel.item.officialRating != nil { Text(viewModel.item.officialRating!).font(.subheadline) .fontWeight(.semibold) .foregroundColor(.secondary) @@ -137,16 +133,6 @@ struct SeriesItemView: View { Spacer() } }.padding(.top, 50) - - if viewModel.nextUpItem != nil { - Text("Next Up") - .font(.headline) - .fontWeight(.semibold) - NavigationLink(destination: ItemView(item: viewModel.nextUpItem!)) { - LandscapeItemElement(item: viewModel.nextUpItem!) - }.buttonStyle(PlainNavigationLinkButtonStyle()).padding(.bottom, 1) - } - if !viewModel.seasons.isEmpty { Text("Seasons") .font(.headline) diff --git a/JellyfinPlayer tvOS/VideoPlayer/MediaInfoView.swift b/JellyfinPlayer tvOS/VideoPlayer/MediaInfoView.swift index f2cf2642..804bf63e 100644 --- a/JellyfinPlayer tvOS/VideoPlayer/MediaInfoView.swift +++ b/JellyfinPlayer tvOS/VideoPlayer/MediaInfoView.swift @@ -55,7 +55,7 @@ struct MediaInfoView: View { Text(item.name ?? "Episode") .foregroundColor(.secondary) - Text(item.getEpisodeLocator()) + Text(item.getEpisodeLocator() ?? "") if let date = item.premiereDate { Text(formatDate(date: date)) diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index fcb469da..12d865cf 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -251,6 +251,7 @@ 62EC353426766B03000E9F2D /* DeviceRotationViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62EC353326766B03000E9F2D /* DeviceRotationViewModifier.swift */; }; 62ECA01826FA685A00E8EBB7 /* DeepLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62ECA01726FA685A00E8EBB7 /* DeepLink.swift */; }; AE8C3159265D6F90008AA076 /* bitrates.json in Resources */ = {isa = PBXBuildFile; fileRef = AE8C3158265D6F90008AA076 /* bitrates.json */; }; + C45B29BB26FAC5B600CEF5E0 /* ColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E173DA5126D04AAF00CC4EB7 /* ColorExtension.swift */; }; E100720726BDABC100CE3E31 /* MediaPlayButtonRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E100720626BDABC100CE3E31 /* MediaPlayButtonRowView.swift */; }; E131691726C583BC0074BFEE /* LogConstructor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E131691626C583BC0074BFEE /* LogConstructor.swift */; }; E131691826C583BC0074BFEE /* LogConstructor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E131691626C583BC0074BFEE /* LogConstructor.swift */; }; @@ -264,6 +265,7 @@ E18845F626DD631E00B0C5B7 /* BaseItemDto+Stackable.swift in Sources */ = {isa = PBXBuildFile; fileRef = E18845F426DD631E00B0C5B7 /* BaseItemDto+Stackable.swift */; }; E18845F826DEA9C900B0C5B7 /* ItemViewBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = E18845F726DEA9C900B0C5B7 /* ItemViewBody.swift */; }; E188460026DECB9E00B0C5B7 /* ItemLandscapeTopBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E18845FF26DECB9E00B0C5B7 /* ItemLandscapeTopBarView.swift */; }; + E188460426DEF04800B0C5B7 /* CardVStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E188460326DEF04800B0C5B7 /* CardVStackView.swift */; }; E188460426DEF04800B0C5B7 /* EpisodeCardVStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E188460326DEF04800B0C5B7 /* EpisodeCardVStackView.swift */; }; E188460526DEF04800B0C5B7 /* EpisodeCardVStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E188460326DEF04800B0C5B7 /* EpisodeCardVStackView.swift */; }; E1AD104A26D94822003E4A08 /* DetailItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD104926D94822003E4A08 /* DetailItem.swift */; }; @@ -275,11 +277,8 @@ E1AD105726D981CE003E4A08 /* PortraitHStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD105526D981CE003E4A08 /* PortraitHStackView.swift */; }; E1AD105926D9A543003E4A08 /* LazyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621338B22660A07800A81A2A /* LazyView.swift */; }; E1AD105C26D9ABDD003E4A08 /* PillHStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD105B26D9ABDD003E4A08 /* PillHStackView.swift */; }; - E1AD105D26D9ABDD003E4A08 /* PillHStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD105B26D9ABDD003E4A08 /* PillHStackView.swift */; }; E1AD105F26D9ADDD003E4A08 /* NameGUIDPairExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD105E26D9ADDD003E4A08 /* NameGUIDPairExtensions.swift */; }; - E1AD106026D9ADDD003E4A08 /* NameGUIDPairExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD105E26D9ADDD003E4A08 /* NameGUIDPairExtensions.swift */; }; E1AD106226D9B7CD003E4A08 /* ItemPortraitHeaderOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD106126D9B7CD003E4A08 /* ItemPortraitHeaderOverlayView.swift */; }; - E1AD106326D9B7CD003E4A08 /* ItemPortraitHeaderOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AD106126D9B7CD003E4A08 /* ItemPortraitHeaderOverlayView.swift */; }; E1F0204E26CCCA74001C1C3B /* VideoPlayerJumpLength.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1F0204D26CCCA74001C1C3B /* VideoPlayerJumpLength.swift */; }; E1F0204F26CCCA74001C1C3B /* VideoPlayerJumpLength.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1F0204D26CCCA74001C1C3B /* VideoPlayerJumpLength.swift */; }; E1FCD08826C35A0D007C8DCF /* NetworkError.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FCD08726C35A0D007C8DCF /* NetworkError.swift */; }; @@ -1505,7 +1504,6 @@ 62E632F4267D54030063E547 /* ItemViewModel.swift in Sources */, 6267B3D826710B9800A7371D /* CollectionExtensions.swift in Sources */, 62E632E7267D3F5B0063E547 /* EpisodeItemViewModel.swift in Sources */, - E1AD106326D9B7CD003E4A08 /* ItemPortraitHeaderOverlayView.swift in Sources */, E100720726BDABC100CE3E31 /* MediaPlayButtonRowView.swift in Sources */, 535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */, 53272532268BF09D0035FBF1 /* MediaViewActionButton.swift in Sources */, @@ -1516,7 +1514,6 @@ 536D3D81267BDFC60004248C /* PortraitItemElement.swift in Sources */, 531690E5267ABD5C005D8AB9 /* MainTabView.swift in Sources */, 5310695B2684E7EE00CFFDBA /* AudioView.swift in Sources */, - E1AD106026D9ADDD003E4A08 /* NameGUIDPairExtensions.swift in Sources */, 5398514726B64E4100101B49 /* SearchBarView.swift in Sources */, 091B5A8D268315D400D78B61 /* ServerDiscovery.swift in Sources */, 53ABFDE7267974EF00886593 /* ConnectToServerViewModel.swift in Sources */, @@ -1528,6 +1525,7 @@ 53649AB2269D019100A2D8B7 /* LogManager.swift in Sources */, 535870AA2669D8AE00D05A09 /* BlurHashDecode.swift in Sources */, 53ABFDE5267974EF00886593 /* ViewModel.swift in Sources */, + C45B29BB26FAC5B600CEF5E0 /* ColorExtension.swift in Sources */, 531069582684E7EE00CFFDBA /* MediaInfoView.swift in Sources */, 6220D0C726D62D8700B8E046 /* VideoPlayerCoordinator.swift in Sources */, 53272537268C1DBB0035FBF1 /* SeasonItemView.swift in Sources */, @@ -2021,7 +2019,7 @@ EXCLUDED_ARCHS = ""; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = JellyfinPlayer/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2058,7 +2056,7 @@ EXCLUDED_ARCHS = ""; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = JellyfinPlayer/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/README.md b/README.md index c0a81406..9cd33173 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Check out our [Weblate instance](https://translate.jellyfin.org/projects/swiftfi ## ⚙️ Development -Xcode 12.5 with command line tools. +Xcode 13.0 with command line tools. ### Build Process diff --git a/Shared/Extensions/ColorExtension.swift b/Shared/Extensions/ColorExtension.swift index 8f9c8e1b..1ac6cdcd 100644 --- a/Shared/Extensions/ColorExtension.swift +++ b/Shared/Extensions/ColorExtension.swift @@ -13,4 +13,13 @@ extension Color { static let jellyfinPurple = Color(red: 172 / 255, green: 92 / 255, blue: 195 / 255) + #if os(tvOS) // tvOS doesn't have these + public static let systemFill = Color(UIColor.white) + public static let secondarySystemFill = Color(UIColor.gray) + public static let tertiarySystemFill = Color(UIColor.black) + #else + public static let systemFill = Color(UIColor.systemFill) + public static let secondarySystemFill = Color(UIColor.secondarySystemBackground) + public static let tertiarySystemFill = Color(UIColor.tertiarySystemBackground) + #endif } diff --git a/Shared/Objects/VideoPlayerJumpLength.swift b/Shared/Objects/VideoPlayerJumpLength.swift index e3a0b282..6a2a38b4 100644 --- a/Shared/Objects/VideoPlayerJumpLength.swift +++ b/Shared/Objects/VideoPlayerJumpLength.swift @@ -14,9 +14,7 @@ enum VideoPlayerJumpLength: Int32, CaseIterable, Defaults.Serializable { case thirty = 30 case fifteen = 15 case ten = 10 - - // TODO - Uncomment once iOS 15 released -// case five = 5 + case five = 5 var label: String { return "\(self.rawValue) seconds" @@ -33,8 +31,8 @@ enum VideoPlayerJumpLength: Int32, CaseIterable, Defaults.Serializable { systemName = "goforward.15" case .ten: systemName = "goforward.10" -// case .five: -// systemName = "goforward.5" + case .five: + systemName = "goforward.5" } return UIImage(systemName: systemName, withConfiguration: config)! @@ -51,8 +49,8 @@ enum VideoPlayerJumpLength: Int32, CaseIterable, Defaults.Serializable { systemName = "gobackward.15" case .ten: systemName = "gobackward.10" -// case .five: -// systemName = "gobackward.5" + case .five: + systemName = "gobackward.5" } return UIImage(systemName: systemName, withConfiguration: config)! diff --git a/Shared/Views/ImageView.swift b/Shared/Views/ImageView.swift index 8f41eedf..1acfc099 100644 --- a/Shared/Views/ImageView.swift +++ b/Shared/Views/ImageView.swift @@ -30,7 +30,7 @@ struct ImageView: View { .failure { ZStack { Rectangle() - .foregroundColor(Color(UIColor.systemFill)) + .foregroundColor(Color.systemFill) Text(failureInitials) .font(.largeTitle) diff --git a/Shared/Views/SearchBarView.swift b/Shared/Views/SearchBarView.swift index 4e565210..ac4b8f32 100644 --- a/Shared/Views/SearchBarView.swift +++ b/Shared/Views/SearchBarView.swift @@ -16,21 +16,13 @@ struct SearchBar: View { var body: some View { HStack(spacing: 8) { - // TODO: Clean up the statement as previously done - // in commit 93a25eb9c43eddd03e09df87722c086fb6cb6da4 - // after Swift 5.5 is released. + TextField(NSLocalizedString("Search...", comment: ""), text: $text) + .padding(8) + .padding(.horizontal, 16) #if os(iOS) - TextField(NSLocalizedString("Search...", comment: ""), text: $text) - .padding(8) - .padding(.horizontal, 16) .background(Color(.systemGray6)) - .cornerRadius(8) - #else - TextField(NSLocalizedString("Search...", comment: ""), text: $text) - .padding(8) - .padding(.horizontal, 16) - .cornerRadius(8) #endif + .cornerRadius(8) if !text.isEmpty { Button(action: { self.text = ""