Files
qbz/crates/qbz-slint/ui/state.slint
T
vicrodh e2e409cf93 feat(qbz-slint): album artwork pipeline
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
2026-05-18 13:05:12 -06:00

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;
}