From 6fe50e890ce6cd8fafcf808ccb6cc083fdc3940c Mon Sep 17 00:00:00 2001 From: Dallas Groot Date: Sat, 4 Apr 2026 07:22:28 -0700 Subject: [PATCH] Update from NavidromePlayer.zip (2026-04-04 07:22) --- iOS/Views/Companion/ZipImportManager.swift | 4 +--- iOS/Views/NowPlaying/NowPlayingView.swift | 15 +-------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/iOS/Views/Companion/ZipImportManager.swift b/iOS/Views/Companion/ZipImportManager.swift index e2a3d85..7046c08 100644 --- a/iOS/Views/Companion/ZipImportManager.swift +++ b/iOS/Views/Companion/ZipImportManager.swift @@ -154,9 +154,7 @@ class ZipImportManager: NSObject, ObservableObject, URLSessionDataDelegate, URLS /// The previous NSFileCoordinator(.forUploading) implementation was wrong: /// it returns a recompressed version of the source, not extracted file contents. private func unzipFile(at zipURL: URL, to destDir: URL) throws { - guard let archive = Archive(url: zipURL, accessMode: .read) else { - throw CompanionError.extractionFailed("Could not open archive at \(zipURL.lastPathComponent)") - } + let archive = try Archive(url: zipURL, accessMode: .read) for entry in archive { guard entry.type == .file else { continue } let destURL = destDir.appendingPathComponent(entry.path) diff --git a/iOS/Views/NowPlaying/NowPlayingView.swift b/iOS/Views/NowPlaying/NowPlayingView.swift index 9325e4b..37e5c02 100644 --- a/iOS/Views/NowPlaying/NowPlayingView.swift +++ b/iOS/Views/NowPlaying/NowPlayingView.swift @@ -210,19 +210,6 @@ struct NowPlayingView: View { vSizeClass == .compact } - /// Derive preferred color scheme from album art dominant color brightness. - /// Most album art is dark enough for .dark (white status bar icons). - /// Very bright covers (white/yellow/light pop art) switch to .light so the - /// status bar icons don't disappear against the blurred background. - private var preferredSchemeForAlbum: ColorScheme { - guard albumColors.isLoaded else { return .dark } - var brightness: CGFloat = 0 - UIColor(albumColors.primaryColor).getHue(nil, saturation: nil, brightness: &brightness, alpha: nil) - // Only flip to .light for genuinely bright albums (>0.85). - // The background overlay darkens most art, so the threshold is high. - return brightness > 0.85 ? .light : .dark - } - /// Whether the current song is a radio stream private var isRadio: Bool { audioPlayer.isRadioStream || audioPlayer.currentSong?.album == "Radio" @@ -291,7 +278,7 @@ struct NowPlayingView: View { } } ) - .preferredColorScheme(preferredSchemeForAlbum) + .preferredColorScheme(.dark) .sheet(isPresented: $showQueue) { if isRadio { RadioRecordingsView(stationName: audioPlayer.currentSong?.title ?? "Radio")