Pull to reload, Umplatzierung Search-Button, Album-Artist

This commit is contained in:
2026-04-06 14:59:32 +02:00
parent 56199db301
commit 040917479e
9 changed files with 247 additions and 187 deletions
@@ -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)")
}
}
}