Skip to content

Commit

Permalink
Fix #99
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Dec 24, 2024
1 parent 622d35e commit f9442c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/_lib/Caches/ExtendedTrackItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export class ExtendedMediaItem {
.catch(libTrace.warn.withContext("MusicBrainz.getUPCReleases"));

// Try validate if the album is valid because sometimes tidal has the wrong upc id!
if (releaseAlbum !== undefined && tidalAlbum.numberOfTracks !== undefined && releaseAlbum.media[(this.tidalTrack.volumeNumber ?? 1) - 1]["track-count"] !== tidalAlbum.numberOfTracks) {
const releaseAlbumTrackCount = releaseAlbum?.media?.[(this.tidalTrack.volumeNumber ?? 1) - 1]?.["track-count"];
if (releaseAlbumTrackCount !== undefined && tidalAlbum.numberOfTracks !== undefined && releaseAlbumTrackCount !== tidalAlbum.numberOfTracks) {
libTrace.warn("Invalid Tidal UPC for album!", { releaseAlbum, tidalAlbum });
return undefined;
}
Expand Down

0 comments on commit f9442c4

Please sign in to comment.