mirror of
https://github.com/Lidarr/Lidarr
synced 2026-03-01 10:05:40 +01:00
Fixed: Don't die on album deleted notifications with the artist already removed
This commit is contained in:
parent
b2f595436b
commit
4abca0c896
1 changed files with 8 additions and 1 deletions
|
|
@ -310,7 +310,14 @@ public void UpdateLastSearchTime(List<Album> albums)
|
|||
public void Handle(ArtistsDeletedEvent message)
|
||||
{
|
||||
// TODO Do this in one call instead of one for each artist?
|
||||
var albums = message.Artists.SelectMany(x => GetAlbumsByArtistMetadataId(x.ArtistMetadataId)).ToList();
|
||||
var albums = message.Artists.SelectMany(artist =>
|
||||
{
|
||||
var artistAlbums = GetAlbumsByArtistMetadataId(artist.ArtistMetadataId);
|
||||
artistAlbums.ForEach(a => a.Artist = artist);
|
||||
|
||||
return artistAlbums;
|
||||
}).ToList();
|
||||
|
||||
DeleteMany(albums);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue