mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Fixed: Don't die when the artist is missing for leftover albums
This commit is contained in:
parent
f63abedbae
commit
897357ff31
1 changed files with 5 additions and 7 deletions
|
@ -73,15 +73,13 @@ namespace Lidarr.Api.V1.Albums
|
|||
|
||||
foreach (var album in albums)
|
||||
{
|
||||
album.Artist = artists[album.ArtistMetadataId];
|
||||
if (releases.TryGetValue(album.Id, out var albumReleases))
|
||||
if (!artists.TryGetValue(album.ArtistMetadataId, out var albumArtist))
|
||||
{
|
||||
album.AlbumReleases = albumReleases;
|
||||
}
|
||||
else
|
||||
{
|
||||
album.AlbumReleases = new List<AlbumRelease>();
|
||||
continue;
|
||||
}
|
||||
|
||||
album.Artist = albumArtist;
|
||||
album.AlbumReleases = releases.TryGetValue(album.Id, out var albumReleases) ? albumReleases : new List<AlbumRelease>();
|
||||
}
|
||||
|
||||
return MapToResource(albums, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue