Pull to reload, Umplatzierung Search-Button, Album-Artist
This commit is contained in:
@@ -103,10 +103,13 @@ struct AlbumDetailView: View {
|
||||
FavoriteButton(uri: album.uri, size: 22, showInLight: true)
|
||||
}
|
||||
}
|
||||
.task {
|
||||
async let tracksLoad: () = loadTracks()
|
||||
async let detailLoad: () = loadAlbumDetail()
|
||||
_ = await (tracksLoad, detailLoad)
|
||||
.task(id: "tracks-\(album.uri)") {
|
||||
await loadTracks()
|
||||
}
|
||||
.task(id: "detail-\(album.uri)") {
|
||||
await loadAlbumDetail()
|
||||
}
|
||||
.onAppear {
|
||||
withAnimation(.linear(duration: 20).repeatForever(autoreverses: true)) {
|
||||
kenBurnsScale = 1.15
|
||||
}
|
||||
@@ -375,17 +378,17 @@ struct AlbumDetailView: View {
|
||||
// MARK: - Actions
|
||||
|
||||
private func loadTracks() async {
|
||||
print("🔵 AlbumDetailView: Loading tracks for album: \(album.name)")
|
||||
print("🔵 AlbumDetailView: Album URI: \(album.uri)")
|
||||
isLoading = true
|
||||
errorMessage = nil
|
||||
|
||||
do {
|
||||
tracks = try await service.libraryManager.getAlbumTracks(albumUri: album.uri)
|
||||
print("✅ AlbumDetailView: Loaded \(tracks.count) tracks")
|
||||
isLoading = false
|
||||
} catch is CancellationError {
|
||||
// View disappeared during load — leave isLoading true so a retry
|
||||
// happens automatically when the view reappears.
|
||||
return
|
||||
} catch {
|
||||
print("❌ AlbumDetailView: Failed to load tracks: \(error)")
|
||||
errorMessage = error.localizedDescription
|
||||
showError = true
|
||||
isLoading = false
|
||||
@@ -408,6 +411,8 @@ struct AlbumDetailView: View {
|
||||
if let desc = detail.metadata?.description, !desc.isEmpty {
|
||||
albumDescription = desc
|
||||
}
|
||||
} catch is CancellationError {
|
||||
return
|
||||
} catch {
|
||||
// Description is optional — silently ignore if unavailable
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user