fix(slint/discover): seed DailyQ/WeeklyQ with Qobuz-only track ids
DailyQ/WeeklyQ build their /dynamic/suggest seed from recently-played track ids. Recently-played now includes local and Plex tracks whose ids are not Qobuz catalog ids — numeric Plex rating keys even passed the u64 parse, so they reached Qobuz and the mix request failed. Filter the seed to Qobuz (and legacy pre-source) tracks before parsing, and skip the request when no Qobuz seeds remain. Local tracks stay visible in the Recent rows. cc
This commit is contained in:
1 file changed
+15
-5
@@ -42,16 +42,26 @@ where
|
||||
{
|
||||
match kind {
|
||||
"daily" | "weekly" => {
|
||||
// Seed /dynamic/suggest with QOBUZ track ids ONLY. Recently-played
|
||||
// now includes local/Plex tracks whose ids are NOT in the Qobuz
|
||||
// catalog (e.g. numeric Plex rating keys that pass the u64 parse);
|
||||
// sending those made the mix request fail. Empty `source` = legacy
|
||||
// pre-source entries (treated as Qobuz). Local/Plex are excluded.
|
||||
let seeds: Vec<u64> = crate::recently::load()
|
||||
.into_iter()
|
||||
.filter(|t| t.source.is_empty() || t.source == "qobuz")
|
||||
.filter_map(|t| t.id.parse::<u64>().ok())
|
||||
.take(50)
|
||||
.collect();
|
||||
runtime
|
||||
.core()
|
||||
.get_dynamic_suggest(&seeds, 50)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
if seeds.is_empty() {
|
||||
Vec::new()
|
||||
} else {
|
||||
runtime
|
||||
.core()
|
||||
.get_dynamic_suggest(&seeds, 50)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
}
|
||||
}
|
||||
"fav" => {
|
||||
let mut tracks = favorite_tracks(runtime).await;
|
||||
|
||||
Reference in new issue
Block a user