From d34d23a052ee11c525edbda4a582e711e5221446 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 21 Dec 2024 15:12:20 -0800 Subject: [PATCH] Fixed: Movies updated during Import List Sync not reflected in the UI (cherry picked from commit 1c30ecd66dd0fd1dafaf9ab0e41a11a54eaac132) Closes #10794 --- .../Movies/Events/MoviesBulkEditedEvent.cs | 15 +++++++++++++++ src/NzbDrone.Core/Movies/MovieService.cs | 3 +++ src/Radarr.Api.V3/Movies/MovieController.cs | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 src/NzbDrone.Core/Movies/Events/MoviesBulkEditedEvent.cs diff --git a/src/NzbDrone.Core/Movies/Events/MoviesBulkEditedEvent.cs b/src/NzbDrone.Core/Movies/Events/MoviesBulkEditedEvent.cs new file mode 100644 index 000000000..3100d2a4b --- /dev/null +++ b/src/NzbDrone.Core/Movies/Events/MoviesBulkEditedEvent.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using NzbDrone.Common.Messaging; + +namespace NzbDrone.Core.Movies.Events +{ + public class MoviesBulkEditedEvent : IEvent + { + public IReadOnlyCollection Movies { get; private set; } + + public MoviesBulkEditedEvent(IReadOnlyCollection movies) + { + Movies = movies; + } + } +} diff --git a/src/NzbDrone.Core/Movies/MovieService.cs b/src/NzbDrone.Core/Movies/MovieService.cs index c2df5bed7..e5248df2b 100644 --- a/src/NzbDrone.Core/Movies/MovieService.cs +++ b/src/NzbDrone.Core/Movies/MovieService.cs @@ -279,6 +279,7 @@ namespace NzbDrone.Core.Movies _movieRepository.UpdateMany(movies); _logger.Debug("{0} movies updated", movies.Count); + _eventAggregator.PublishEvent(new MoviesBulkEditedEvent(movies)); return movies; } @@ -331,6 +332,8 @@ namespace NzbDrone.Core.Movies return true; } + _logger.Debug("Tags not updated for '{0}'", movie.Title); + return false; } diff --git a/src/Radarr.Api.V3/Movies/MovieController.cs b/src/Radarr.Api.V3/Movies/MovieController.cs index 439218547..33c35988f 100644 --- a/src/Radarr.Api.V3/Movies/MovieController.cs +++ b/src/Radarr.Api.V3/Movies/MovieController.cs @@ -39,6 +39,7 @@ namespace Radarr.Api.V3.Movies IHandle, IHandle, IHandle, + IHandle, IHandle { private readonly IMovieService _moviesService; @@ -370,6 +371,15 @@ namespace Radarr.Api.V3.Movies BroadcastResourceChange(ModelAction.Updated, MapToResource(message.Movie)); } + [NonAction] + public void Handle(MoviesBulkEditedEvent message) + { + foreach (var movie in message.Movies) + { + BroadcastResourceChange(ModelAction.Updated, MapToResource(movie)); + } + } + [NonAction] public void Handle(MediaCoversUpdatedEvent message) {