Skip to content

Commit

Permalink
lib.MaxTrack - properly handle undefined extTrackItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Oct 7, 2024
1 parent 70ebb0d commit edd980f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/_lib/MaxTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export class MaxTrack {
if (maxTrack !== undefined) return maxTrack;

const extTrackItem = await ExtendedMediaItem.get(itemId);
if (extTrackItem === undefined) return false;
const trackItem = extTrackItem?.tidalTrack;
if (trackItem === undefined || trackItem.contentType !== "track" || this.hasHiRes(trackItem)) return false;
if (trackItem.contentType !== "track" || this.hasHiRes(trackItem)) return false;

const isrcs = await extTrackItem?.isrcs();
const isrcs = await extTrackItem.isrcs();
if (isrcs === undefined) return (this._maxTrackMap[itemId] = Promise.resolve(false));

return (this._maxTrackMap[itemId] = (async () => {
Expand Down

0 comments on commit edd980f

Please sign in to comment.