mirror of https://github.com/lidarr/Lidarr
Fixed: Broadcast album updated if track file deleted
Ensures that album stats update in the Artist details page if track files are deleted.
This commit is contained in:
parent
d9dfd32568
commit
75e2ace49e
|
@ -13,6 +13,7 @@ using NzbDrone.Core.Download;
|
|||
using NzbDrone.Core.Music.Events;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
|
||||
namespace Lidarr.Api.V1.Albums
|
||||
{
|
||||
|
@ -20,7 +21,8 @@ namespace Lidarr.Api.V1.Albums
|
|||
IHandle<AlbumGrabbedEvent>,
|
||||
IHandle<AlbumEditedEvent>,
|
||||
IHandle<AlbumImportedEvent>,
|
||||
IHandle<TrackImportedEvent>
|
||||
IHandle<TrackImportedEvent>,
|
||||
IHandle<TrackFileDeletedEvent>
|
||||
|
||||
{
|
||||
protected readonly IReleaseService _releaseService;
|
||||
|
@ -129,5 +131,12 @@ namespace Lidarr.Api.V1.Albums
|
|||
{
|
||||
BroadcastResourceChange(ModelAction.Updated, message.TrackInfo.Album.ToResource());
|
||||
}
|
||||
|
||||
public void Handle(TrackFileDeletedEvent message)
|
||||
{
|
||||
if (message.Reason == DeleteMediaFileReason.Upgrade) return;
|
||||
|
||||
BroadcastResourceChange(ModelAction.Updated, MapToResource(message.TrackFile.Album.Value, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue