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);
|
prev_disc = Some(track.disc);
|
||||||
// Blacklist key: the row's own performer id, falling back to the
|
// Blacklist key: the row's own performer id, falling back to the
|
||||||
// album's primary artist when the track carries none (Task 6).
|
// 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() {
|
let row_artist_id = if track.artist_id.is_empty() {
|
||||||
album_artist_id.as_str()
|
album_artist_id.as_str()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ pub struct TrackCard {
|
|||||||
pub title: String,
|
pub title: String,
|
||||||
pub artist: String,
|
pub artist: String,
|
||||||
pub artist_id: 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: String,
|
||||||
pub album_id: String,
|
pub album_id: String,
|
||||||
pub genre: String,
|
pub genre: String,
|
||||||
@@ -404,11 +407,17 @@ fn map_track(track: Track) -> TrackCard {
|
|||||||
.performer
|
.performer
|
||||||
.map(|p| (p.name, p.id.to_string()))
|
.map(|p| (p.name, p.id.to_string()))
|
||||||
.unwrap_or_default();
|
.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 {
|
TrackCard {
|
||||||
id: track.id.to_string(),
|
id: track.id.to_string(),
|
||||||
title,
|
title,
|
||||||
artist,
|
artist,
|
||||||
artist_id,
|
artist_id,
|
||||||
|
composer_id,
|
||||||
album,
|
album,
|
||||||
album_id,
|
album_id,
|
||||||
genre,
|
genre,
|
||||||
@@ -466,7 +475,7 @@ pub fn apply_favorites(window: &AppWindow, data: FavData) {
|
|||||||
.map(|t| TrackItem {
|
.map(|t| TrackItem {
|
||||||
is_blacklisted: crate::artist_blacklist::stamp_row(
|
is_blacklisted: crate::artist_blacklist::stamp_row(
|
||||||
"qobuz",
|
"qobuz",
|
||||||
&[t.artist_id.as_str()],
|
&[t.artist_id.as_str(), t.composer_id.as_str()],
|
||||||
),
|
),
|
||||||
id: t.id.clone().into(),
|
id: t.id.clone().into(),
|
||||||
number: "".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()) {
|
if let Some(v) = track.version.as_ref().filter(|v| !v.is_empty()) {
|
||||||
title = format!("{title} ({v})");
|
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
|
let performer_id = track
|
||||||
.performer
|
.performer
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|p| p.id.to_string())
|
.map(|p| p.id.to_string())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
let composer_id = track
|
||||||
|
.composer
|
||||||
|
.as_ref()
|
||||||
|
.map(|c| c.id.to_string())
|
||||||
|
.unwrap_or_default();
|
||||||
TrackItem {
|
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(),
|
id: track.id.to_string().into(),
|
||||||
number: "".into(),
|
number: "".into(),
|
||||||
title: title.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()) {
|
if let Some(v) = track.version.as_ref().filter(|v| !v.is_empty()) {
|
||||||
title = format!("{title} ({v})");
|
title = format!("{title} ({v})");
|
||||||
}
|
}
|
||||||
// Blacklist key: the track's performer id (pure-Qobuz playlist rows;
|
// Blacklist key: the track's performer OR composer id (pure-Qobuz playlist
|
||||||
// local / Plex rows go through local_playlist::row_item, never stamped).
|
// 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
|
let performer_id = track
|
||||||
.performer
|
.performer
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|p| p.id.to_string())
|
.map(|p| p.id.to_string())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
let composer_id = track
|
||||||
|
.composer
|
||||||
|
.as_ref()
|
||||||
|
.map(|c| c.id.to_string())
|
||||||
|
.unwrap_or_default();
|
||||||
TrackItem {
|
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(),
|
id: track.id.to_string().into(),
|
||||||
number: "".into(),
|
number: "".into(),
|
||||||
title: title.into(),
|
title: title.into(),
|
||||||
|
|||||||
Reference in new issue
Block a user