mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
make artist stats for navidrome api sane
This commit is contained in:
parent
592376316f
commit
41c2a7da69
2 changed files with 9 additions and 2 deletions
|
|
@ -279,7 +279,7 @@ const normalizeAlbumArtist = (
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
albumCount: item.albumCount,
|
albumCount: item.stats?.albumartist.albumCount || item.albumCount,
|
||||||
backgroundImageUrl: null,
|
backgroundImageUrl: null,
|
||||||
biography: item.biography || null,
|
biography: item.biography || null,
|
||||||
duration: null,
|
duration: null,
|
||||||
|
|
@ -304,7 +304,7 @@ const normalizeAlbumArtist = (
|
||||||
imageUrl: artist?.artistImageUrl || null,
|
imageUrl: artist?.artistImageUrl || null,
|
||||||
name: artist.name,
|
name: artist.name,
|
||||||
})) || null,
|
})) || null,
|
||||||
songCount: item.songCount,
|
songCount: item.stats?.albumartist.songCount || item.songCount,
|
||||||
userFavorite: item.starred,
|
userFavorite: item.starred,
|
||||||
userRating: item.rating,
|
userRating: item.rating,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,12 @@ const genreListParameters = paginationParameters.extend({
|
||||||
|
|
||||||
const genreList = z.array(genre);
|
const genreList = z.array(genre);
|
||||||
|
|
||||||
|
const stats = z.object({
|
||||||
|
albumCount: z.number(),
|
||||||
|
size: z.number(),
|
||||||
|
songCount: z.number(),
|
||||||
|
});
|
||||||
|
|
||||||
const albumArtist = z.object({
|
const albumArtist = z.object({
|
||||||
albumCount: z.number(),
|
albumCount: z.number(),
|
||||||
biography: z.string(),
|
biography: z.string(),
|
||||||
|
|
@ -91,6 +97,7 @@ const albumArtist = z.object({
|
||||||
songCount: z.number(),
|
songCount: z.number(),
|
||||||
starred: z.boolean(),
|
starred: z.boolean(),
|
||||||
starredAt: z.string(),
|
starredAt: z.string(),
|
||||||
|
stats: z.record(z.string(), stats).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const albumArtistList = z.array(albumArtist);
|
const albumArtistList = z.array(albumArtist);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue