Pull to reload, Umplatzierung Search-Button, Album-Artist
This commit is contained in:
@@ -61,11 +61,13 @@ struct ArtistDetailView: View {
|
||||
FavoriteButton(uri: artist.uri, size: 22, showInLight: true)
|
||||
}
|
||||
}
|
||||
.task {
|
||||
async let albumsLoad: () = loadAlbums()
|
||||
async let detailLoad: () = loadArtistDetail()
|
||||
_ = await (albumsLoad, detailLoad)
|
||||
// Start Ken Burns animation
|
||||
.task(id: "albums-\(artist.uri)") {
|
||||
await loadAlbums()
|
||||
}
|
||||
.task(id: "detail-\(artist.uri)") {
|
||||
await loadArtistDetail()
|
||||
}
|
||||
.onAppear {
|
||||
withAnimation(.linear(duration: 20).repeatForever(autoreverses: true)) {
|
||||
kenBurnsScale = 1.15
|
||||
}
|
||||
@@ -218,16 +220,14 @@ struct ArtistDetailView: View {
|
||||
// MARK: - Actions
|
||||
|
||||
private func loadAlbums() async {
|
||||
print("🔵 ArtistDetailView: Loading albums for artist: \(artist.name)")
|
||||
print("🔵 ArtistDetailView: Artist URI: \(artist.uri)")
|
||||
isLoading = true
|
||||
errorMessage = nil
|
||||
do {
|
||||
albums = try await service.libraryManager.getArtistAlbums(artistUri: artist.uri)
|
||||
print("✅ ArtistDetailView: Loaded \(albums.count) albums")
|
||||
isLoading = false
|
||||
} catch is CancellationError {
|
||||
return
|
||||
} catch {
|
||||
print("❌ ArtistDetailView: Failed to load albums: \(error)")
|
||||
errorMessage = error.localizedDescription
|
||||
showError = true
|
||||
isLoading = false
|
||||
@@ -240,9 +240,10 @@ struct ArtistDetailView: View {
|
||||
if let desc = detail.metadata?.description, !desc.isEmpty {
|
||||
biography = desc
|
||||
}
|
||||
} catch is CancellationError {
|
||||
return
|
||||
} catch {
|
||||
// Biography is optional — silently ignore if unavailable
|
||||
print("ℹ️ ArtistDetailView: Could not load artist detail: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user