feat(slint): recently-played store and Discover Home section
Close the Recently Played Tracks tech debt: a JSON-backed play-history store at the shared QBZ data path, surfaced as a slim-card section on Discover Home (it hides while empty). - recently.rs: load() reads the store newest-first; record() prepends a track, dedupes by id and caps the list — the playback session calls record() when a track starts - home.rs threads a `recent` list into HomeData; HomeView renders a "Recently Played" GridSection; artwork pipeline gains an ArtworkTarget::Recent The data path is complete end to end; only record() awaits the playback session. cc
This commit is contained in:
8 files changed
+181
-21
No files matched your search
@@ -35,6 +35,8 @@ pub enum ArtworkTarget {
|
||||
Section { section_idx: usize, album_idx: usize },
|
||||
/// A card in `HomeState.popular[idx]`.
|
||||
Popular { idx: usize },
|
||||
/// A card in `HomeState.recent[idx]`.
|
||||
Recent { idx: usize },
|
||||
}
|
||||
|
||||
/// An artwork download job: which card, and the image URL.
|
||||
@@ -188,5 +190,13 @@ fn apply_artwork(
|
||||
item.artwork = image;
|
||||
popular.set_row_data(idx, item);
|
||||
}
|
||||
ArtworkTarget::Recent { idx } => {
|
||||
let recent = home.get_recent();
|
||||
let Some(mut item) = recent.row_data(idx) else {
|
||||
return;
|
||||
};
|
||||
item.artwork = image;
|
||||
recent.set_row_data(idx, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user