From d61b59223e6ac375afdf587d2fbcd0457e8eb53a Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 12 Jul 2026 19:38:43 -0600 Subject: [PATCH] fix(favorites): show owned playlists in the Library playlists tab load_favorites built the Playlists Library sub-tab only from locally-hearted ids and the Following list excludes owner.id == uid, so the user's own playlists appeared nowhere. Seed the Library list with owned playlists first, then hearted-but-not-owned (dedup). Fixes desktop and kiosk. cc --- crates/qbz/src/favorites.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/qbz/src/favorites.rs b/crates/qbz/src/favorites.rs index aa09da96b..54644317d 100644 --- a/crates/qbz/src/favorites.rs +++ b/crates/qbz/src/favorites.rs @@ -237,8 +237,23 @@ where let fav_ids = crate::library_db::with_db(|db| db.get_favorite_playlist_ids()).unwrap_or_default(); let by_id: HashMap = all.iter().map(|p| (p.id, p)).collect(); - let mut favorites: Vec = Vec::with_capacity(fav_ids.len()); + // The user's OWNED playlists belong in their Library sub-tab. They don't + // come back from SQLite as "favorites" unless manually hearted, and the + // Following list above explicitly excludes them (owner.id != uid), so + // without seeding them here they appear NOWHERE (bug: only followed + // playlists showed). Owned first, then hearted-but-not-owned (dedup). + let mut favorites: Vec = Vec::new(); + let mut seen: std::collections::HashSet = std::collections::HashSet::new(); + if let Some(uid) = uid { + for p in all.iter().filter(|p| p.owner.id == uid) { + seen.insert(p.id); + favorites.push(search::map_playlist(p.clone())); + } + } for fid in fav_ids { + if !seen.insert(fid) { + continue; + } if let Some(p) = by_id.get(&fid) { favorites.push(search::map_playlist((**p).clone())); } else if let Ok(p) = runtime.core().get_playlist(fid).await {