diff --git a/crates/qbz-core/src/core.rs b/crates/qbz-core/src/core.rs index 12bee64d8..6bfcb382c 100644 --- a/crates/qbz-core/src/core.rs +++ b/crates/qbz-core/src/core.rs @@ -3863,6 +3863,7 @@ mod tests { .collect(); Album { favorited_at: None, + purchasable: None, id: String::new(), title: String::new(), artist: Artist { @@ -3900,6 +3901,7 @@ mod tests { fn track_with(performer_id: Option, composer_id: Option) -> Track { Track { favorited_at: None, + purchasable: None, id: 0, title: String::new(), version: None, diff --git a/crates/qbz-models/src/types.rs b/crates/qbz-models/src/types.rs index 281302d90..092e68639 100644 --- a/crates/qbz-models/src/types.rs +++ b/crates/qbz-models/src/types.rs @@ -518,6 +518,10 @@ pub struct Track { /// Favourites-list rows only (unix seconds); see `Album::favorited_at`. #[serde(default, deserialize_with = "crate::purchase_serde::lenient_option")] pub favorited_at: Option, + /// Store flag from the catalog (`purchasable`): `Some(false)` is the API + /// saying this release is not sold on Qobuz; absence is unknown, not no. + #[serde(default)] + pub purchasable: Option, #[serde(default)] pub title: String, /// Subtitle/edition info from Qobuz (e.g. "Player's Ball Mix", @@ -730,6 +734,10 @@ pub struct Album { /// it (unix seconds); every other album shape leaves it `None`. #[serde(default, deserialize_with = "crate::purchase_serde::lenient_option")] pub favorited_at: Option, + /// Store flag from the catalog (`purchasable`): `Some(false)` is the API + /// saying this release is not sold on Qobuz; absence is unknown, not no. + #[serde(default)] + pub purchasable: Option, #[serde(default)] pub title: String, #[serde(default)] diff --git a/crates/qbz-playlist-import/src/match_qobuz.rs b/crates/qbz-playlist-import/src/match_qobuz.rs index 1130b441b..065bfe6b6 100644 --- a/crates/qbz-playlist-import/src/match_qobuz.rs +++ b/crates/qbz-playlist-import/src/match_qobuz.rs @@ -393,6 +393,7 @@ mod tests { fn qobuz_track(id: u64, title: &str, artist: &str) -> Track { Track { favorited_at: None, + purchasable: None, id, title: title.to_string(), version: None,