mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -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)
|
foreach (var album in albums)
|
||||||
{
|
{
|
||||||
album.Artist = artists[album.ArtistMetadataId];
|
if (!artists.TryGetValue(album.ArtistMetadataId, out var albumArtist))
|
||||||
if (releases.TryGetValue(album.Id, out var albumReleases))
|
|
||||||
{
|
{
|
||||||
album.AlbumReleases = albumReleases;
|
continue;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
album.AlbumReleases = new List<AlbumRelease>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
album.Artist = albumArtist;
|
||||||
|
album.AlbumReleases = releases.TryGetValue(album.Id, out var albumReleases) ? albumReleases : new List<AlbumRelease>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return MapToResource(albums, false);
|
return MapToResource(albums, false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue