fix(locallibrary): track-row source indicator (drop fav/offline) + AlbumView favorite item

LocalLibrary track rows (Tracks tab + local album detail) no longer carry the
favorite or offline-cache columns — they don't apply to local content. Instead
they show a subtle per-source indicator (local -> hard-drive tinted; qobuz
offline / plex -> their mark), small + flat rather than the bold album-card
badge (mirrors Tauri's track-row local indicator). TrackItem gains a `source`
field, set by every constructor (Qobuz surfaces -> "qobuz"; map_local_track ->
local/qobuz/plex); TrackRow gains `show-source`.

Also fixes Qobuz AlbumView: the track list had a Favorite column header but the
rows never rendered the heart (show-favorite defaulted false). AlbumPageView
now sets show-favorite + show-download for Qobuz albums (matching the header)
and the source indicator for local albums, with the column header switched to
match each.

cc
This commit is contained in:
vicrodh committed 2026-05-29 08:43:26 -06:00
1 parent 6e1009afd0
commit c36b99b8e8
12 files changed
+60 -6

No files matched your search

+2
View File
@@ -259,6 +259,8 @@ pub fn apply_album(window: &AppWindow, data: AlbumData) {
removing: false,
cache_status: if crate::offline_cache::is_cached(&track.id) { 3 } else { 0 },
cache_progress: 0.0,
// Qobuz album-detail rows; local albums override via map_local_track.
source: "qobuz".into(),
unlocking: false,
})
.collect();
+1
View File
@@ -505,6 +505,7 @@ pub fn apply_artist(window: &AppWindow, data: ArtistData) {
removing: false,
cache_status: if crate::offline_cache::is_cached(&track.id) { 3 } else { 0 },
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
})
.collect();
+1
View File
@@ -421,6 +421,7 @@ pub fn apply_favorites(window: &AppWindow, data: FavData) {
removing: false,
cache_status: if crate::offline_cache::is_cached(&t.id) { 3 } else { 0 },
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
})
.collect();
+1
View File
@@ -765,6 +765,7 @@ fn top_track_to_item(t: &TopTrack) -> TrackItem {
removing: false,
cache_status: if crate::offline_cache::is_cached(&t.id) { 3 } else { 0 },
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
}
}
+7
View File
@@ -454,6 +454,13 @@ fn map_local_track(t: qbz_library::LocalTrack) -> TrackItem {
removing: false,
cache_status: 0,
cache_progress: 0.0,
// Source indicator: offline copies read as Qobuz, user files as local.
source: match t.source.as_deref() {
Some("qobuz_download") => "qobuz",
Some("plex") => "plex",
_ => "local",
}
.into(),
unlocking: false,
}
}
+1
View File
@@ -177,6 +177,7 @@ fn to_item(track: &Track) -> TrackItem {
removing: false,
cache_status: if crate::offline_cache::is_cached(&track.id.to_string()) { 3 } else { 0 },
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
}
}
+1
View File
@@ -384,6 +384,7 @@ fn to_item(track: &Track) -> TrackItem {
removing: false,
cache_status: if crate::offline_cache::is_cached(&track.id.to_string()) { 3 } else { 0 },
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
}
}
+1
View File
@@ -375,6 +375,7 @@ fn track_item(row: TrackRowData) -> TrackItem {
removing: false,
cache_status: if is_cached { 3 } else { 0 },
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
}
}