feat: For You — radio, album suggestions, rediscover, more-from-library

Completes the remaining For You sections by porting two Qobuz API
endpoints down into qbz-core and adding the local "forgotten
favorites" approximation.

Backend ports (qbz-models + qbz-qobuz + qbz-core):
  - /album/suggest -> AlbumSuggestResponse, QobuzClient::get_album_suggest,
    QbzCore::get_album_suggest.
  - /radio/artist + /radio/album -> RadioResponse, get_radio_artist /
    get_radio_album on the client + core. (Faithful ports of the legacy
    src-tauri/api/client.rs methods — same paths, params, shapes.)

For You sections:
  - Radio Stations — album-seeded radio tiles (recent + favorite
    albums, deduped, capped 12), rendered with RadioCard; click starts
    a real Qobuz album radio.
  - More From Your Library — /album/suggest seeded from the most recent
    played album (else first favorite).
  - Rediscover Your Library — favorite albums not in the local
    play-history (approximation of Tauri's reco-DB forgotten
    favorites).
  - Spotlight's RADIO card + the artist "radio" action now create a
    real Qobuz artist radio (playback::play_artist_radio /
    play_album_radio build a queue from the radio track list and play).

Section order now matches Tauri: Qobuz Mixes, Release Watch, Radio
Stations, Recently Played Tracks/Albums, Your Top Artists, More From
Your Library, Rediscover, Artists to Follow, Spotlight.

Still backend-blocked: the Qobuz mix detail views (DailyQ/WeeklyQ/etc.)
and the smart radio_engine (the Qobuz radio used here is the simpler
/radio/* endpoint, not the local pool builder).

cc
This commit is contained in:
vicrodh committed 2026-05-21 06:43:53 -06:00
1 parent 83b7721b10
commit c19a5b84dd
12 files changed
+457 -14

No files matched your search

+64 -2
View File
@@ -9,12 +9,14 @@
// (More from library, Rediscover) are later increments.
import { Theme } from "../foundation/semantic-colors.slint";
import { ForYouState } from "../state.slint";
import { Typography } from "../foundation/typography.slint";
import { ForYouState, RadioStationItem } from "../state.slint";
import { Carousel } from "Carousel.slint";
import { SlimCarousel } from "SlimCarousel.slint";
import { ArtistCarousel } from "ArtistCarousel.slint";
import { Spotlight } from "Spotlight.slint";
import { QobuzMixesRow } from "QobuzMixesRow.slint";
import { RadioCard } from "RadioCard.slint";
import { LoadingSpinner } from "../primitives/LoadingSpinner.slint";
export component ForYouView inherits VerticalLayout {
@@ -24,6 +26,7 @@ export component ForYouView inherits VerticalLayout {
callback play-track(string);
callback play-top-tracks(string);
callback start-radio(string);
callback start-radio-album(string);
callback open-mix(string);
spacing: 40px;
@@ -54,6 +57,43 @@ export component ForYouView inherits VerticalLayout {
}
}
// 1b. Radio Stations — album-seeded radio tiles.
if ForYouState.radio-stations.length > 0: VerticalLayout {
spacing: 12px;
Text {
text: @tr("Radio Stations");
color: Theme.text-primary;
font-size: 18px;
font-weight: Typography.semibold;
}
Rectangle {
height: 234px;
clip: true;
radio-flick := Flickable {
width: 100%;
height: parent.height;
viewport-width: ForYouState.radio-stations.length * (180px + 32px);
viewport-height: self.height;
HorizontalLayout {
spacing: 32px;
alignment: start;
for st in ForYouState.radio-stations: RadioCard {
seed-title: st.title;
seed-subtitle: st.artist;
label: "RADIO";
artwork: st.artwork;
clicked => {
root.start-radio-album(st.album-id);
}
play => {
root.start-radio-album(st.album-id);
}
}
}
}
}
}
// 2. Recently Played Tracks.
if ForYouState.recent-tracks.length > 0: SlimCarousel {
title: @tr("Recently Played Tracks");
@@ -86,7 +126,29 @@ export component ForYouView inherits VerticalLayout {
}
}
// 5. Artists to Follow.
// 5. More From Your Library.
if ForYouState.more-from-library.albums.length > 0: Carousel {
section: ForYouState.more-from-library;
album-clicked(id) => {
root.open-album(id);
}
media-action(kind, id, action) => {
root.media-action(kind, id, action);
}
}
// 6. Rediscover Your Library.
if ForYouState.rediscover.albums.length > 0: Carousel {
section: ForYouState.rediscover;
album-clicked(id) => {
root.open-album(id);
}
media-action(kind, id, action) => {
root.media-action(kind, id, action);
}
}
// 6. Artists to Follow.
if ForYouState.artists-to-follow.length > 0: ArtistCarousel {
title: @tr("Artists to Follow");
artists: ForYouState.artists-to-follow;
@@ -283,6 +283,9 @@ export component HomeView inherits Rectangle {
start-radio(id) => {
root.media-action("artist", id, "radio");
}
start-radio-album(id) => {
root.media-action("album", id, "radio");
}
open-mix(which) => {
root.media-action("mix", which, "open");
}