diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs index cc54dc1cb..d0c8b6deb 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs @@ -29,6 +29,8 @@ namespace NzbDrone.Core.Download.TrackedDownloads public class TrackedDownloadService : ITrackedDownloadService, IHandle, IHandle, + IHandle, + IHandle, IHandle { private readonly IParsingService _parsingService; @@ -305,6 +307,38 @@ namespace NzbDrone.Core.Download.TrackedDownloads } } + public void Handle(SeriesEditedEvent message) + { + var cachedItems = _cache.Values + .Where(t => + t.RemoteEpisode?.Series != null && + (t.RemoteEpisode.Series.Id == message.Series?.Id || t.RemoteEpisode.Series.TvdbId == message.Series?.TvdbId)) + .ToList(); + + if (cachedItems.Any()) + { + cachedItems.ForEach(UpdateCachedItem); + + _eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(GetTrackedDownloads())); + } + } + + public void Handle(SeriesBulkEditedEvent message) + { + var cachedItems = _cache.Values + .Where(t => + t.RemoteEpisode?.Series != null && + message.Series.Any(s => s.Id == t.RemoteEpisode.Series.Id || s.TvdbId == t.RemoteEpisode.Series.TvdbId)) + .ToList(); + + if (cachedItems.Any()) + { + cachedItems.ForEach(UpdateCachedItem); + + _eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(GetTrackedDownloads())); + } + } + public void Handle(SeriesDeletedEvent message) { var cachedItems = _cache.Values