mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Fix bug where error occurs when there are no artists in the library
This commit is contained in:
@@ -342,6 +342,8 @@ export class Navidrome implements MusicService {
|
||||
"subsonic-response.album.song",
|
||||
"subsonic-response.albumList.album",
|
||||
"subsonic-response.artist.album",
|
||||
"subsonic-response.artists.index",
|
||||
"subsonic-response.artists.index.artist",
|
||||
"subsonic-response.artistInfo.similarArtist",
|
||||
"subsonic-response.genres.genre",
|
||||
"subsonic-response.playlist.entry",
|
||||
@@ -378,7 +380,7 @@ export class Navidrome implements MusicService {
|
||||
|
||||
getArtists = (credentials: Credentials): Promise<IdName[]> =>
|
||||
this.getJSON<GetArtistsResponse>(credentials, "/rest/getArtists")
|
||||
.then((it) => it.artists.index.flatMap((it) => it.artist || []))
|
||||
.then((it) => (it.artists.index || []).flatMap((it) => it.artist || []))
|
||||
.then((artists) =>
|
||||
artists.map((artist) => ({
|
||||
id: artist._id,
|
||||
|
||||
Reference in New Issue
Block a user