mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
minor artist count fixes
This commit is contained in:
parent
f03d88cd8c
commit
781d8055b5
6 changed files with 47 additions and 18 deletions
|
|
@ -278,11 +278,25 @@ const normalizeAlbumArtist = (
|
|||
});
|
||||
}
|
||||
|
||||
let albumCount: number;
|
||||
let songCount: number;
|
||||
|
||||
if (item.stats) {
|
||||
albumCount = Math.max(
|
||||
item.stats.albumartist?.albumCount ?? 0,
|
||||
item.stats.artist?.albumCount ?? 0,
|
||||
);
|
||||
songCount = Math.max(
|
||||
item.stats.albumartist?.songCount ?? 0,
|
||||
item.stats.artist?.songCount ?? 0,
|
||||
);
|
||||
} else {
|
||||
albumCount = item.albumCount;
|
||||
songCount = item.songCount;
|
||||
}
|
||||
|
||||
return {
|
||||
albumCount: Math.max(
|
||||
item.stats?.albumartist?.albumCount || item.albumCount,
|
||||
item.stats?.artist?.albumCount || 0,
|
||||
),
|
||||
albumCount,
|
||||
backgroundImageUrl: null,
|
||||
biography: item.biography || null,
|
||||
duration: null,
|
||||
|
|
@ -307,7 +321,7 @@ const normalizeAlbumArtist = (
|
|||
imageUrl: artist?.artistImageUrl || null,
|
||||
name: artist.name,
|
||||
})) || null,
|
||||
songCount: item.stats?.albumartist?.songCount || item.songCount,
|
||||
songCount,
|
||||
userFavorite: item.starred,
|
||||
userRating: item.rating,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ export const SubsonicController: ControllerEndpoint = {
|
|||
|
||||
return {
|
||||
...ssNormalize.albumArtist(artist, apiClientProps.server, 300),
|
||||
albums: artist.album.map((album) => ssNormalize.album(album, apiClientProps.server)),
|
||||
albums: artist.album?.map((album) => ssNormalize.album(album, apiClientProps.server)),
|
||||
similarArtists:
|
||||
artistInfo?.similarArtist?.map((artist) =>
|
||||
ssNormalize.albumArtist(artist, apiClientProps.server, 300),
|
||||
|
|
@ -305,7 +305,7 @@ export const SubsonicController: ControllerEndpoint = {
|
|||
return [];
|
||||
}
|
||||
|
||||
return artist.body.artist.album;
|
||||
return artist.body.artist.album ?? [];
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
@ -966,7 +966,7 @@ export const SubsonicController: ControllerEndpoint = {
|
|||
return [];
|
||||
}
|
||||
|
||||
return artist.body.artist.album;
|
||||
return artist.body.artist.album ?? [];
|
||||
});
|
||||
|
||||
const albumIds = albums.map((album) => album.id);
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ const albumListParameters = z.object({
|
|||
const albumList = z.array(album.omit({ song: true }));
|
||||
|
||||
const albumArtist = z.object({
|
||||
album: z.array(album),
|
||||
album: z.array(album).optional(),
|
||||
albumCount: z.string(),
|
||||
artistImageUrl: z.string().optional(),
|
||||
coverArt: z.string().optional(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue