mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
remove remixer from navidrome album type
This commit is contained in:
@@ -54,6 +54,7 @@ const getArtists = (
|
|||||||
| z.infer<typeof ndType._response.album>
|
| z.infer<typeof ndType._response.album>
|
||||||
| z.infer<typeof ndType._response.playlistSong>
|
| z.infer<typeof ndType._response.playlistSong>
|
||||||
| z.infer<typeof ndType._response.song>,
|
| z.infer<typeof ndType._response.song>,
|
||||||
|
includeRemixers = true,
|
||||||
) => {
|
) => {
|
||||||
let albumArtists: RelatedArtist[] | undefined;
|
let albumArtists: RelatedArtist[] | undefined;
|
||||||
let artists: RelatedArtist[] | undefined;
|
let artists: RelatedArtist[] | undefined;
|
||||||
@@ -75,7 +76,7 @@ const getArtists = (
|
|||||||
|
|
||||||
if (role === 'albumartist') {
|
if (role === 'albumartist') {
|
||||||
albumArtists = roleList;
|
albumArtists = roleList;
|
||||||
} else if (role === 'remixer') {
|
} else if (role === 'remixer' && includeRemixers) {
|
||||||
remixers = roleList;
|
remixers = roleList;
|
||||||
} else {
|
} else {
|
||||||
artists = roleList;
|
artists = roleList;
|
||||||
@@ -124,7 +125,7 @@ const getArtists = (
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (artists === undefined && remixers === undefined) {
|
if (artists === undefined && (includeRemixers ? remixers === undefined : true)) {
|
||||||
artists = [
|
artists = [
|
||||||
{
|
{
|
||||||
id: item.artistId,
|
id: item.artistId,
|
||||||
@@ -137,7 +138,11 @@ const getArtists = (
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return { albumArtists, artists: [...(artists || []), ...(remixers || [])], participants };
|
return {
|
||||||
|
albumArtists,
|
||||||
|
artists: [...(artists || []), ...(includeRemixers ? remixers || [] : [])],
|
||||||
|
participants,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const normalizeSong = (
|
const normalizeSong = (
|
||||||
@@ -160,7 +165,7 @@ const normalizeSong = (
|
|||||||
return {
|
return {
|
||||||
album: item.album,
|
album: item.album,
|
||||||
albumId: item.albumId,
|
albumId: item.albumId,
|
||||||
...getArtists(item),
|
...getArtists(item, true),
|
||||||
_itemType: LibraryItem.SONG,
|
_itemType: LibraryItem.SONG,
|
||||||
_serverId: server?.id || 'unknown',
|
_serverId: server?.id || 'unknown',
|
||||||
_serverType: ServerType.NAVIDROME,
|
_serverType: ServerType.NAVIDROME,
|
||||||
@@ -278,7 +283,7 @@ const normalizeAlbum = (
|
|||||||
): Album => {
|
): Album => {
|
||||||
return {
|
return {
|
||||||
...parseAlbumTags(item),
|
...parseAlbumTags(item),
|
||||||
...getArtists(item),
|
...getArtists(item, false),
|
||||||
_itemType: LibraryItem.ALBUM,
|
_itemType: LibraryItem.ALBUM,
|
||||||
_serverId: server?.id || 'unknown',
|
_serverId: server?.id || 'unknown',
|
||||||
_serverType: ServerType.NAVIDROME,
|
_serverType: ServerType.NAVIDROME,
|
||||||
|
|||||||
Reference in New Issue
Block a user