Discover cards now show real Qobuz cover art. Artwork is fetched and decoded off the UI thread, capped at 16 concurrent downloads, and each result is applied to its own card row on the Slint event loop — so a cover arriving never resets a section. - artwork.rs: download + decode worker and per-row apply. - AlbumCardItem gains an `artwork` image field; AlbumCard overlays the cover, falling back to the elevated placeholder until it resolves. - main.rs: after the discover sections render, artwork jobs are spawned for every card with an image URL. qbz-slint now depends on reqwest and image. cc
28 lines
804 B
Plaintext
28 lines
804 B
Plaintext
// Shared UI state — structs and globals the Rust controllers populate.
|
|
//
|
|
// The Rust side builds these models on a worker thread, then sets them
|
|
// on the global from the Slint event loop (see src/home.rs, src/main.rs).
|
|
|
|
export struct AlbumCardItem {
|
|
id: string,
|
|
title: string,
|
|
artist: string,
|
|
quality: string,
|
|
ribbon: string,
|
|
ribbon-kind: string, // "press" | "qobuzissime" | "albumOfTheWeek" | ""
|
|
artwork-url: string,
|
|
artwork: image, // empty until the artwork pipeline resolves it
|
|
}
|
|
|
|
export struct DiscoverSection {
|
|
title: string,
|
|
albums: [AlbumCardItem],
|
|
}
|
|
|
|
// Discover / Home screen state.
|
|
export global HomeState {
|
|
in property <string> greeting: "";
|
|
in property <[DiscoverSection]> sections: [];
|
|
in property <bool> loading: false;
|
|
}
|