feat(slint): recently-played albums section on Discover Home
Discover Home now has both recently-played modules: a carousel of album cards and the slim track grid (renamed "Recently Played Tracks"). - recently.rs records track plays with their album metadata; load_albums() derives the distinct recent albums from that history - home.rs threads a recent_albums list into HomeData; HomeView renders it as a carousel; the artwork pipeline gains ArtworkTarget::RecentAlbum Also raises the header-gradient contrast: the artwork color is now saturation-boosted off its average and normalized to a fixed peak brightness instead of just darkened, so the tint is actually visible. cc
This commit is contained in:
6 files changed
+165
-42
No files matched your search
@@ -188,8 +188,21 @@ export component HomeView inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
if HomeState.recent-albums.length > 0: Carousel {
|
||||
section: {
|
||||
title: @tr("Recently Played Albums"),
|
||||
albums: HomeState.recent-albums,
|
||||
};
|
||||
album-clicked(id) => {
|
||||
root.album-clicked(id);
|
||||
}
|
||||
media-action(kind, id, action) => {
|
||||
root.media-action(kind, id, action);
|
||||
}
|
||||
}
|
||||
|
||||
if HomeState.recent.length > 0: GridSection {
|
||||
title: @tr("Recently Played");
|
||||
title: @tr("Recently Played Tracks");
|
||||
items: HomeState.recent;
|
||||
item-clicked(id) => {
|
||||
root.media-action("track", id, "play");
|
||||
|
||||
@@ -38,6 +38,7 @@ export global HomeState {
|
||||
in property <[DiscoverSection]> sections: [];
|
||||
in property <[SlimItem]> popular: [];
|
||||
in property <[SlimItem]> recent: [];
|
||||
in property <[AlbumCardItem]> recent-albums: [];
|
||||
in property <bool> loading: false;
|
||||
}
|
||||
|
||||
@@ -59,6 +60,10 @@ export global AlbumState {
|
||||
in property <string> artist-id;
|
||||
in property <string> info-line;
|
||||
in property <string> quality-tier;
|
||||
// "24-bit / 96 kHz" — quality-badge detail line.
|
||||
in property <string> quality-detail;
|
||||
// Editorial description / review (HTML stripped). May be empty.
|
||||
in property <string> description;
|
||||
in property <image> artwork;
|
||||
// Artwork-derived tint for the header gradient.
|
||||
in property <color> header-color: #181820;
|
||||
|
||||
Reference in new issue
Block a user