Add albumartists to related album

This commit is contained in:
jeffvli
2022-11-08 12:04:10 -08:00
parent 2652ab927f
commit a964662ad4
+10 -2
View File
@@ -156,12 +156,19 @@ const imageUrl = (
return null; return null;
}; };
const relatedAlbum = (item: Album) => { const relatedAlbum = (
item: Album & {
albumArtists: AlbumArtist[];
}
) => {
return { return {
/* eslint-disable sort-keys-fix/sort-keys-fix */ /* eslint-disable sort-keys-fix/sort-keys-fix */
id: item.id, id: item.id,
name: item.name, name: item.name,
remoteId: item.remoteId, remoteId: item.remoteId,
albumArtists: item.albumArtists
? relatedAlbumArtists(item.albumArtists)
: [],
deleted: item.deleted, deleted: item.deleted,
/* eslint-enable sort-keys-fix/sort-keys-fix */ /* eslint-enable sort-keys-fix/sort-keys-fix */
}; };
@@ -325,7 +332,7 @@ const buildImageUrl = (options: {
type DbSong = Song & DbSongInclude; type DbSong = Song & DbSongInclude;
type DbSongInclude = { type DbSongInclude = {
album: Album & { images: Image[] }; album: Album & { albumArtists: AlbumArtist[]; images: Image[] };
artists: Artist[]; artists: Artist[];
externals: External[]; externals: External[];
genres: Genre[]; genres: Genre[];
@@ -650,6 +657,7 @@ const tasks = (options: { items: DbTask[] | any[] }) => {
export const toApiModel = { export const toApiModel = {
albums, albums,
genres,
servers, servers,
songs, songs,
tasks, tasks,