Skip to content

Commit b91ff9c

Browse files
committed
fix(Tidal): Handle API response without image links
These were apparently removed yesterday without prior announcement... It seems to be possible to restore image support using a new API include parameter, which is yet another breaking change for permalinks :(
1 parent c00b971 commit b91ff9c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

providers/Tidal/v2/api_types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ export type AlbumsAttributes = {
4040
/** Defines an album availability e.g. for streaming, DJs, stems */
4141
availability: Availability[];
4242
mediaTags: string[];
43-
imageLinks: MediaLink[];
44-
videoLinks: MediaLink[];
43+
/** @deprecated Removed 2025-06-17 (without announcement). */
44+
imageLinks?: MediaLink[];
45+
/** @deprecated Removed 2025-06-17 (without announcement). */
46+
videoLinks?: MediaLink[];
4547
externalLinks: ExternalLink[];
4648
type: 'ALBUM' | 'EP' | 'SINGLE';
4749
};

providers/Tidal/v2/lookup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,14 @@ export class TidalV2ReleaseLookup extends ReleaseApiLookup<TidalProvider, Single
270270
}
271271

272272
private getArtwork(rawRelease: SingleDataDocument<ReleaseResource>): Artwork | undefined {
273-
const allImages = rawRelease.data.attributes.imageLinks.map((link) => {
273+
const allImages = rawRelease.data.attributes.imageLinks?.map((link) => {
274274
return {
275275
url: link.href,
276276
width: link.meta.width,
277277
height: link.meta.height,
278278
};
279279
});
280-
return selectLargestImage(allImages, ['front']);
280+
return allImages ? selectLargestImage(allImages, ['front']) : undefined;
281281
}
282282

283283
private getLabels(rawRelease: SingleDataDocument<ReleaseResource>): Label[] {

0 commit comments

Comments
 (0)