From 54d543faf71059c2277a2b5c7a552af46739bd3c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 21 Dec 2024 15:12:20 -0800 Subject: [PATCH] Fixed: Series updated during Import List Sync not reflected in the UI Closes #7511 --- .../Tv/Events/SeriesBulkEditedEvent.cs | 15 +++++++++++++++ src/NzbDrone.Core/Tv/SeriesService.cs | 3 +++ src/Sonarr.Api.V3/Series/SeriesController.cs | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 src/NzbDrone.Core/Tv/Events/SeriesBulkEditedEvent.cs diff --git a/src/NzbDrone.Core/Tv/Events/SeriesBulkEditedEvent.cs b/src/NzbDrone.Core/Tv/Events/SeriesBulkEditedEvent.cs new file mode 100644 index 000000000..7fbf23e48 --- /dev/null +++ b/src/NzbDrone.Core/Tv/Events/SeriesBulkEditedEvent.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using NzbDrone.Common.Messaging; + +namespace NzbDrone.Core.Tv.Events +{ + public class SeriesBulkEditedEvent : IEvent + { + public List Series { get; private set; } + + public SeriesBulkEditedEvent(List series) + { + Series = series; + } + } +} diff --git a/src/NzbDrone.Core/Tv/SeriesService.cs b/src/NzbDrone.Core/Tv/SeriesService.cs index d34c63be4..29cb6fac5 100644 --- a/src/NzbDrone.Core/Tv/SeriesService.cs +++ b/src/NzbDrone.Core/Tv/SeriesService.cs @@ -251,6 +251,7 @@ namespace NzbDrone.Core.Tv _seriesRepository.UpdateMany(series); _logger.Debug("{0} series updated", series.Count); + _eventAggregator.PublishEvent(new SeriesBulkEditedEvent(series)); return series; } @@ -298,6 +299,8 @@ namespace NzbDrone.Core.Tv return true; } + _logger.Debug("Tags not updated for '{0}'", series.Title); + return false; } } diff --git a/src/Sonarr.Api.V3/Series/SeriesController.cs b/src/Sonarr.Api.V3/Series/SeriesController.cs index 7122af7e9..73c95aafd 100644 --- a/src/Sonarr.Api.V3/Series/SeriesController.cs +++ b/src/Sonarr.Api.V3/Series/SeriesController.cs @@ -34,6 +34,7 @@ namespace Sonarr.Api.V3.Series IHandle, IHandle, IHandle, + IHandle, IHandle { private readonly ISeriesService _seriesService; @@ -338,6 +339,15 @@ namespace Sonarr.Api.V3.Series BroadcastResourceChange(ModelAction.Updated, message.Series.Id); } + [NonAction] + public void Handle(SeriesBulkEditedEvent message) + { + foreach (var series in message.Series) + { + BroadcastResourceChange(ModelAction.Updated, series.ToResource()); + } + } + [NonAction] public void Handle(MediaCoversUpdatedEvent message) {