fix(slint): include composer id in blacklist row stamp (match queue predicate)
cc
This commit is contained in:
4 files changed
+41
-6
No files matched your search
@@ -339,6 +339,12 @@ pub fn apply_album(window: &AppWindow, data: AlbumData) {
|
||||
prev_disc = Some(track.disc);
|
||||
// Blacklist key: the row's own performer id, falling back to the
|
||||
// album's primary artist when the track carries none (Task 6).
|
||||
// NOTE: the album-track row model (`TrackData`) does NOT carry a
|
||||
// composer id — only performer/album-primary — so the composer leg
|
||||
// of the D-FEAT predicate is not available here. The album queue
|
||||
// builder filters off the raw `Track` (which DOES carry composer)
|
||||
// via `qbz_core::track_blacklisted`, so play-all still honors
|
||||
// composer; only this row greyout is performer/album-primary-only.
|
||||
let row_artist_id = if track.artist_id.is_empty() {
|
||||
album_artist_id.as_str()
|
||||
} else {
|
||||
|
||||
@@ -116,6 +116,9 @@ pub struct TrackCard {
|
||||
pub title: String,
|
||||
pub artist: String,
|
||||
pub artist_id: String,
|
||||
/// Composer id for the blacklist row stamp (D-FEAT: performer OR composer);
|
||||
/// "" when the track carries no composer.
|
||||
pub composer_id: String,
|
||||
pub album: String,
|
||||
pub album_id: String,
|
||||
pub genre: String,
|
||||
@@ -404,11 +407,17 @@ fn map_track(track: Track) -> TrackCard {
|
||||
.performer
|
||||
.map(|p| (p.name, p.id.to_string()))
|
||||
.unwrap_or_default();
|
||||
// Composer id for the blacklist row stamp (D-FEAT: performer OR composer).
|
||||
let composer_id = track
|
||||
.composer
|
||||
.map(|c| c.id.to_string())
|
||||
.unwrap_or_default();
|
||||
TrackCard {
|
||||
id: track.id.to_string(),
|
||||
title,
|
||||
artist,
|
||||
artist_id,
|
||||
composer_id,
|
||||
album,
|
||||
album_id,
|
||||
genre,
|
||||
@@ -466,7 +475,7 @@ pub fn apply_favorites(window: &AppWindow, data: FavData) {
|
||||
.map(|t| TrackItem {
|
||||
is_blacklisted: crate::artist_blacklist::stamp_row(
|
||||
"qobuz",
|
||||
&[t.artist_id.as_str()],
|
||||
&[t.artist_id.as_str(), t.composer_id.as_str()],
|
||||
),
|
||||
id: t.id.clone().into(),
|
||||
number: "".into(),
|
||||
|
||||
@@ -240,14 +240,24 @@ fn to_item(track: &Track) -> TrackItem {
|
||||
if let Some(v) = track.version.as_ref().filter(|v| !v.is_empty()) {
|
||||
title = format!("{title} ({v})");
|
||||
}
|
||||
// Blacklist key: the track's performer id (Qobuz mixes; Task 6).
|
||||
// Blacklist key: the track's performer OR composer id (Qobuz mixes; Task 6).
|
||||
// Composer included so the row greyout matches the queue predicate
|
||||
// (D-FEAT: performer OR composer).
|
||||
let performer_id = track
|
||||
.performer
|
||||
.as_ref()
|
||||
.map(|p| p.id.to_string())
|
||||
.unwrap_or_default();
|
||||
let composer_id = track
|
||||
.composer
|
||||
.as_ref()
|
||||
.map(|c| c.id.to_string())
|
||||
.unwrap_or_default();
|
||||
TrackItem {
|
||||
is_blacklisted: crate::artist_blacklist::stamp_row("qobuz", &[performer_id.as_str()]),
|
||||
is_blacklisted: crate::artist_blacklist::stamp_row(
|
||||
"qobuz",
|
||||
&[performer_id.as_str(), composer_id.as_str()],
|
||||
),
|
||||
id: track.id.to_string().into(),
|
||||
number: "".into(),
|
||||
title: title.into(),
|
||||
|
||||
@@ -493,15 +493,25 @@ pub(crate) fn to_item(track: &Track) -> TrackItem {
|
||||
if let Some(v) = track.version.as_ref().filter(|v| !v.is_empty()) {
|
||||
title = format!("{title} ({v})");
|
||||
}
|
||||
// Blacklist key: the track's performer id (pure-Qobuz playlist rows;
|
||||
// local / Plex rows go through local_playlist::row_item, never stamped).
|
||||
// Blacklist key: the track's performer OR composer id (pure-Qobuz playlist
|
||||
// rows; local / Plex rows go through local_playlist::row_item, never
|
||||
// stamped). Composer included so the row greyout matches the queue
|
||||
// predicate (D-FEAT: performer OR composer).
|
||||
let performer_id = track
|
||||
.performer
|
||||
.as_ref()
|
||||
.map(|p| p.id.to_string())
|
||||
.unwrap_or_default();
|
||||
let composer_id = track
|
||||
.composer
|
||||
.as_ref()
|
||||
.map(|c| c.id.to_string())
|
||||
.unwrap_or_default();
|
||||
TrackItem {
|
||||
is_blacklisted: crate::artist_blacklist::stamp_row("qobuz", &[performer_id.as_str()]),
|
||||
is_blacklisted: crate::artist_blacklist::stamp_row(
|
||||
"qobuz",
|
||||
&[performer_id.as_str(), composer_id.as_str()],
|
||||
),
|
||||
id: track.id.to_string().into(),
|
||||
number: "".into(),
|
||||
title: title.into(),
|
||||
|
||||
Reference in new issue
Block a user