mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
fix Jellyfin imageId normalization
This commit is contained in:
@@ -154,7 +154,7 @@ const normalizeSong = (
|
|||||||
artists: (item?.ArtistItems?.length ? item.ArtistItems : item.AlbumArtists)?.map(
|
artists: (item?.ArtistItems?.length ? item.ArtistItems : item.AlbumArtists)?.map(
|
||||||
(entry) => ({
|
(entry) => ({
|
||||||
id: entry.Id,
|
id: entry.Id,
|
||||||
imageId: entry.Id,
|
imageId: null,
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
name: entry.Name,
|
name: entry.Name,
|
||||||
}),
|
}),
|
||||||
@@ -292,7 +292,7 @@ const normalizeAlbumArtist = (
|
|||||||
item.similarArtists?.Items?.filter((entry) => entry.Name !== 'Various Artists').map(
|
item.similarArtists?.Items?.filter((entry) => entry.Name !== 'Various Artists').map(
|
||||||
(entry) => ({
|
(entry) => ({
|
||||||
id: entry.Id,
|
id: entry.Id,
|
||||||
imageId: entry.Id,
|
imageId: getAlbumArtistImageId(entry),
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
name: entry.Name,
|
name: entry.Name,
|
||||||
}),
|
}),
|
||||||
@@ -392,6 +392,14 @@ const normalizeMusicFolder = (item: z.infer<typeof jfType._response.musicFolder>
|
|||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
const getGenreImageId = (item: z.infer<typeof jfType._response.genre>): null | string => {
|
||||||
|
if (item.ImageTags?.Primary) {
|
||||||
|
return item.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
const normalizeGenre = (
|
const normalizeGenre = (
|
||||||
item: z.infer<typeof jfType._response.genre>,
|
item: z.infer<typeof jfType._response.genre>,
|
||||||
server: null | ServerListItem,
|
server: null | ServerListItem,
|
||||||
@@ -402,7 +410,7 @@ const normalizeGenre = (
|
|||||||
_serverType: ServerType.JELLYFIN,
|
_serverType: ServerType.JELLYFIN,
|
||||||
albumCount: null,
|
albumCount: null,
|
||||||
id: item.Id,
|
id: item.Id,
|
||||||
imageId: item.Id,
|
imageId: getGenreImageId(item),
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
name: item.Name,
|
name: item.Name,
|
||||||
songCount: null,
|
songCount: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user