diff --git a/src/shared/api/jellyfin/jellyfin-normalize.ts b/src/shared/api/jellyfin/jellyfin-normalize.ts index 71598e23c..6a76aa5ba 100644 --- a/src/shared/api/jellyfin/jellyfin-normalize.ts +++ b/src/shared/api/jellyfin/jellyfin-normalize.ts @@ -154,7 +154,7 @@ const normalizeSong = ( artists: (item?.ArtistItems?.length ? item.ArtistItems : item.AlbumArtists)?.map( (entry) => ({ id: entry.Id, - imageId: entry.Id, + imageId: null, imageUrl: null, name: entry.Name, }), @@ -292,7 +292,7 @@ const normalizeAlbumArtist = ( item.similarArtists?.Items?.filter((entry) => entry.Name !== 'Various Artists').map( (entry) => ({ id: entry.Id, - imageId: entry.Id, + imageId: getAlbumArtistImageId(entry), imageUrl: null, name: entry.Name, }), @@ -392,6 +392,14 @@ const normalizeMusicFolder = (item: z.infer // }; // }; +const getGenreImageId = (item: z.infer): null | string => { + if (item.ImageTags?.Primary) { + return item.Id; + } + + return null; +}; + const normalizeGenre = ( item: z.infer, server: null | ServerListItem, @@ -402,7 +410,7 @@ const normalizeGenre = ( _serverType: ServerType.JELLYFIN, albumCount: null, id: item.Id, - imageId: item.Id, + imageId: getGenreImageId(item), imageUrl: null, name: item.Name, songCount: null,