diff --git a/tidaldy/src/models.rs b/tidaldy/src/models.rs index 39f67d4..f4f935a 100644 --- a/tidaldy/src/models.rs +++ b/tidaldy/src/models.rs @@ -212,7 +212,16 @@ impl Track { album: self.album.clone().map(|a| a.into()), duration: self.duration.map(|d| d as u32 * 1000), is_skipped: false, - provider_item_id: self.id.to_string(), + // Prefer the ISRC (the recording identity) so the same recording + // reached via different Tidal track ids — album vs single vs + // compilation — de-duplicates in the content store; fall back to + // the track id when the listing omits it. The library `path` + // above still uses the numeric track id, so streaming resolves. + provider_item_id: self + .isrc + .clone() + .filter(|isrc| !isrc.is_empty()) + .unwrap_or_else(|| self.id.to_string()), is_captured: false, } }