Update from NavidromePlayer.zip (2026-04-04 07:22)
This commit is contained in:
parent
899e9e7c2f
commit
6fe50e890c
2 changed files with 2 additions and 17 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue