From ccce42df6096a8fa8abc8d03740ca1a0cbed78f9 Mon Sep 17 00:00:00 2001 From: PangMo5 Date: Tue, 12 Oct 2021 19:37:51 +0900 Subject: [PATCH 1/3] fix tvOS build error --- JellyfinPlayer.xcodeproj/project.pbxproj | 2 + .../Coordinators/ItemCoordinator.swift | 71 +++++++++++++------ 2 files changed, 52 insertions(+), 21 deletions(-) diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index 3b1434b8..b1243290 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -197,6 +197,7 @@ 625CB57A2678C4A400530A6E /* ActivityIndicator in Frameworks */ = {isa = PBXBuildFile; productRef = 625CB5792678C4A400530A6E /* ActivityIndicator */; }; 6260FFF926A09754003FA968 /* CombineExt in Frameworks */ = {isa = PBXBuildFile; productRef = 6260FFF826A09754003FA968 /* CombineExt */; }; 6261A0E026A0AB710072EF1C /* CombineExt in Frameworks */ = {isa = PBXBuildFile; productRef = 6261A0DF26A0AB710072EF1C /* CombineExt */; }; + 62671DB327159C1800199D95 /* ItemCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6220D0BF26D61C5000B8E046 /* ItemCoordinator.swift */; }; 6267B3D626710B8900A7371D /* CollectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6267B3D526710B8900A7371D /* CollectionExtensions.swift */; }; 6267B3D726710B9700A7371D /* CollectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6267B3D526710B8900A7371D /* CollectionExtensions.swift */; }; 6267B3D826710B9800A7371D /* CollectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6267B3D526710B8900A7371D /* CollectionExtensions.swift */; }; @@ -1494,6 +1495,7 @@ E1FCD08926C35A0D007C8DCF /* NetworkError.swift in Sources */, 531690ED267ABF46005D8AB9 /* ContinueWatchingView.swift in Sources */, 62EC3530267666A5000E9F2D /* SessionManager.swift in Sources */, + 62671DB327159C1800199D95 /* ItemCoordinator.swift in Sources */, E1AD104B26D94822003E4A08 /* DetailItem.swift in Sources */, 53272539268C20100035FBF1 /* EpisodeItemView.swift in Sources */, 531690F7267ACC00005D8AB9 /* LandscapeItemElement.swift in Sources */, diff --git a/JellyfinPlayer/Coordinators/ItemCoordinator.swift b/JellyfinPlayer/Coordinators/ItemCoordinator.swift index d8f4588f..12781b52 100644 --- a/JellyfinPlayer/Coordinators/ItemCoordinator.swift +++ b/JellyfinPlayer/Coordinators/ItemCoordinator.swift @@ -12,33 +12,62 @@ import JellyfinAPI import Stinsen import SwiftUI -final class ItemCoordinator: NavigationCoordinatable { - let stack = NavigationStack(initial: \ItemCoordinator.start) +#if os(iOS) + final class ItemCoordinator: NavigationCoordinatable { + let stack = NavigationStack(initial: \ItemCoordinator.start) - @Root var start = makeStart - @Route(.push) var item = makeItem - @Route(.push) var library = makeLibrary - @Route(.fullScreen) var videoPlayer = makeVideoPlayer + @Root var start = makeStart + @Route(.push) var item = makeItem + @Route(.push) var library = makeLibrary + @Route(.fullScreen) var videoPlayer = makeVideoPlayer - let itemDto: BaseItemDto + let itemDto: BaseItemDto - init(item: BaseItemDto) { - self.itemDto = item + init(item: BaseItemDto) { + self.itemDto = item + } + + func makeLibrary(params: LibraryCoordinatorParams) -> LibraryCoordinator { + LibraryCoordinator(viewModel: params.viewModel, title: params.title) + } + + func makeItem(item: BaseItemDto) -> ItemCoordinator { + ItemCoordinator(item: item) + } + + func makeVideoPlayer(item: BaseItemDto) -> NavigationViewCoordinator { + NavigationViewCoordinator(VideoPlayerCoordinator(item: item)) + } + + @ViewBuilder func makeStart() -> some View { + ItemNavigationView(item: itemDto) + } } - func makeLibrary(params: LibraryCoordinatorParams) -> LibraryCoordinator { - LibraryCoordinator(viewModel: params.viewModel, title: params.title) - } +#elseif os(tvOS) + // temp for fixing build error + final class ItemCoordinator: NavigationCoordinatable { + let stack = NavigationStack(initial: \ItemCoordinator.start) - func makeItem(item: BaseItemDto) -> ItemCoordinator { - ItemCoordinator(item: item) - } + @Root var start = makeStart + @Route(.push) var item = makeItem + @Route(.push) var library = makeLibrary + @Route(.fullScreen) var videoPlayer = makeVideoPlayer - func makeVideoPlayer(item: BaseItemDto) -> NavigationViewCoordinator { - NavigationViewCoordinator(VideoPlayerCoordinator(item: item)) - } + @ViewBuilder func makeStart() -> some View { + EmptyView() + } - @ViewBuilder func makeStart() -> some View { - ItemNavigationView(item: itemDto) + @ViewBuilder func makeLibrary(params: (viewModel: LibraryViewModel, title: String)) -> some View { + EmptyView() + } + + @ViewBuilder func makeItem(item: BaseItemDto) -> some View { + EmptyView() + } + + @ViewBuilder func makeVideoPlayer(item: BaseItemDto) -> some View { + EmptyView() + } } -} +#endif From 93349be9543ce7986f17bc309bedef9c526e9552 Mon Sep 17 00:00:00 2001 From: vladaad Date: Tue, 12 Oct 2021 10:43:43 -0400 Subject: [PATCH 2/3] Added translation using Weblate (Czech) --- Translations/cs.lproj/Localizable.strings | Bin 0 -> 4 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Translations/cs.lproj/Localizable.strings diff --git a/Translations/cs.lproj/Localizable.strings b/Translations/cs.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..ed60b89c47319bc2c37b5775c777dddd6a16d56b GIT binary patch literal 4 LcmezWkBb2S2Mz)V literal 0 HcmV?d00001 From e0606db5b7cebaa36494ed030cda1f02f13436dd Mon Sep 17 00:00:00 2001 From: vladaad Date: Tue, 12 Oct 2021 14:47:26 +0000 Subject: [PATCH 3/3] Translated using Weblate (Czech) Currently translated at 13.3% (10 of 75 strings) Translation: Swiftfin/Swiftfin Translate-URL: https://translate.jellyfin.org/projects/swiftfin/swiftfin/cs/ --- Translations/cs.lproj/Localizable.strings | Bin 4 -> 698 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Translations/cs.lproj/Localizable.strings b/Translations/cs.lproj/Localizable.strings index ed60b89c47319bc2c37b5775c777dddd6a16d56b..a8ebb359e62f7aeb29395b4adb656d0f098572d6 100644 GIT binary patch literal 698 zcmaKq!D_-l6h-fB{RKCYMSnuNP#1+lK&TYVE~d8H*fG?kkcA)X(uKd!_RPfCC`}k< zV3PChd-uKh`R=KwKof0cSxY6#HDGT!pSXYO%bx-Fdv>6y=4P!7;$3S`r#EZ?HSExR zL~+9^^@@Up?$*BL+x0`m=oOrmewT919$>Bd=Kq@86>5Iua}5;Y>IFY>!_Tu~<9fOx zLyXH%#|u++sE&Rh+S2W%b}jKG@q2UdRN3h8%6onzvTb6KKJaJH)4HB&RmB*ML}?>) z#Dx1MzvLOwRp-vVi#zs&h>YpGFZQbDh!<0!RdF+)wV+2S^Zx5uLO$np$NvR;<2gsv UZ^2bCHz$Z3y^Ji*!|AN?3;ro_j{pDw literal 4 LcmezWkBb2S2Mz)V