From 3235f8046df85c3c8b6ad0d6e4f9d98d5776c9ab Mon Sep 17 00:00:00 2001 From: PangMo5 Date: Thu, 26 Aug 2021 02:22:28 +0900 Subject: [PATCH] fix suggested changes --- JellyfinPlayer.xcodeproj/project.pbxproj | 14 +++++++------- JellyfinPlayer/SettingsView.swift | 1 + Shared/Singleton/AppURLHandler.swift | 15 --------------- Shared/ViewModels/ConnectToServerViewModel.swift | 4 ---- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index 1e32bbae..e0ad0104 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -977,16 +977,16 @@ 62C29E9D26D0FE5900C1D2E7 /* Coordinators */ = { isa = PBXGroup; children = ( + 62C29EA226D1030F00C1D2E7 /* ConnectToServerCoodinator.swift */, + 6220D0B926D6092100B8E046 /* FilterCoordinator.swift */, + 62C29EA526D1036A00C1D2E7 /* HomeCoordinator.swift */, + 6220D0BF26D61C5000B8E046 /* ItemCoordinator.swift */, + 6220D0B326D5ED8000B8E046 /* LibraryCoordinator.swift */, + 62C29EA726D103D500C1D2E7 /* LibraryListCoordinator.swift */, 62C29E9E26D1016600C1D2E7 /* MainCoordinator.swift */, 62C29EA026D102A500C1D2E7 /* MainTabCoordinator.swift */, - 62C29EA226D1030F00C1D2E7 /* ConnectToServerCoodinator.swift */, - 62C29EA526D1036A00C1D2E7 /* HomeCoordinator.swift */, - 62C29EA726D103D500C1D2E7 /* LibraryListCoordinator.swift */, - 6220D0B026D5EC9900B8E046 /* SettingsCoordinator.swift */, - 6220D0B326D5ED8000B8E046 /* LibraryCoordinator.swift */, 6220D0B626D5EE1100B8E046 /* SearchCoordinator.swift */, - 6220D0B926D6092100B8E046 /* FilterCoordinator.swift */, - 6220D0BF26D61C5000B8E046 /* ItemCoordinator.swift */, + 6220D0B026D5EC9900B8E046 /* SettingsCoordinator.swift */, 6220D0C526D62D8700B8E046 /* VideoPlayerCoordinator.swift */, ); path = Coordinators; diff --git a/JellyfinPlayer/SettingsView.swift b/JellyfinPlayer/SettingsView.swift index 769f2615..2f3d491e 100644 --- a/JellyfinPlayer/SettingsView.swift +++ b/JellyfinPlayer/SettingsView.swift @@ -44,6 +44,7 @@ struct SettingsView: View { Spacer() Text(ServerEnvironment.current.server.name ?? "") .foregroundColor(.jellyfinPurple) + Image(systemName: "chevron.right") } } diff --git a/Shared/Singleton/AppURLHandler.swift b/Shared/Singleton/AppURLHandler.swift index 33805a37..3b83027f 100644 --- a/Shared/Singleton/AppURLHandler.swift +++ b/Shared/Singleton/AppURLHandler.swift @@ -9,7 +9,6 @@ import Foundation import Stinsen -import URLNavigator final class AppURLHandler { static let deepLinkScheme = "jellyfin" @@ -46,7 +45,6 @@ extension AppURLHandler { guard url.scheme == Self.deepLinkScheme || url.scheme == "widget-extension" else { return false } - print(AppURLHandler.shared.appURLState.allowedScheme(with: url)) if AppURLHandler.shared.appURLState.allowedScheme(with: url) { if launchURL == nil { return processURL(url) @@ -58,8 +56,6 @@ extension AppURLHandler { } func processLaunchedURLIfNeeded() { - print("!@#!@#!@#!@#!@#!@") - print(launchURL) guard let launchURL = launchURL else { return } if processDeepLink(url: launchURL) { self.launchURL = nil @@ -67,7 +63,6 @@ extension AppURLHandler { } private func processURL(_ url: URL) -> Bool { - print("processURL(_ url: URL) -> Bool") if processURLForUser(url: url) { return true } @@ -76,15 +71,6 @@ extension AppURLHandler { } private func processURLForUser(url: URL) -> Bool { - print("processURLForUser(_ url: URL) -> Bool") - print(url) - print(url.host) - print(url.path) - print(url.pathComponents) - print(url.pathComponents[safe: 0]) - print(url.pathComponents[safe: 1]) - print(url.pathComponents[safe: 2]) - print(url.pathComponents[safe: 3]) guard url.host?.lowercased() == "users", url.pathComponents[safe: 1]?.isEmpty == false else { return false } @@ -92,7 +78,6 @@ extension AppURLHandler { if url.pathComponents[safe: 2]?.lowercased() == "items", let itemID = url.pathComponents[safe: 3] { - print("Passed!@#") router?.route(to: .item(viewModel: .init(id: itemID))) return true } diff --git a/Shared/ViewModels/ConnectToServerViewModel.swift b/Shared/ViewModels/ConnectToServerViewModel.swift index 06d8ad54..d3cf7794 100644 --- a/Shared/ViewModels/ConnectToServerViewModel.swift +++ b/Shared/ViewModels/ConnectToServerViewModel.swift @@ -29,10 +29,6 @@ final class ConnectToServerViewModel: ViewModel { private let discovery = ServerDiscovery() @Published var servers: [ServerDiscovery.ServerLookupResponse] = [] @Published var searching = false - - override init() { - super.init() - } func getPublicUsers() { if ServerEnvironment.current.server != nil {