From 75e2ace49e04231156d71100debfa9eae5decf0b Mon Sep 17 00:00:00 2001 From: ta264 Date: Tue, 29 Oct 2019 21:27:27 +0000 Subject: [PATCH] Fixed: Broadcast album updated if track file deleted Ensures that album stats update in the Artist details page if track files are deleted. --- src/Lidarr.Api.V1/Albums/AlbumModule.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Lidarr.Api.V1/Albums/AlbumModule.cs b/src/Lidarr.Api.V1/Albums/AlbumModule.cs index 5f0b9ff96..6b4dc827a 100644 --- a/src/Lidarr.Api.V1/Albums/AlbumModule.cs +++ b/src/Lidarr.Api.V1/Albums/AlbumModule.cs @@ -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, IHandle, IHandle, - IHandle + IHandle, + IHandle { 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)); + } } }