From 363be4ca3462160d573fa6141ed5f815ca11308c Mon Sep 17 00:00:00 2001 From: Qstick Date: Wed, 11 Mar 2020 22:09:08 -0400 Subject: [PATCH] Fixed: Metadata files not being created after rescan Co-Authored-By: Mark McDowall --- src/NzbDrone.Api/Movies/MovieModule.cs | 5 ++++- src/NzbDrone.Core/MediaCover/MediaCoverService.cs | 6 ++---- src/NzbDrone.Core/MediaCover/MediaCoversUpdatedEvent.cs | 5 ++++- src/Radarr.Api.V3/Movies/MovieModule.cs | 5 ++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/NzbDrone.Api/Movies/MovieModule.cs b/src/NzbDrone.Api/Movies/MovieModule.cs index 49b2ec24c..30a3c08b7 100644 --- a/src/NzbDrone.Api/Movies/MovieModule.cs +++ b/src/NzbDrone.Api/Movies/MovieModule.cs @@ -187,7 +187,10 @@ public void Handle(MovieRenamedEvent message) public void Handle(MediaCoversUpdatedEvent message) { - BroadcastResourceChange(ModelAction.Updated, message.Movie.Id); + if (message.Updated) + { + BroadcastResourceChange(ModelAction.Updated, message.Movie.Id); + } } } } diff --git a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs index f31ab78a7..e54d2a89a 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs @@ -191,10 +191,8 @@ private void EnsureResizedCovers(Movie movie, MediaCover cover, bool forceResize public void HandleAsync(MovieUpdatedEvent message) { var updated = EnsureCovers(message.Movie); - if (updated) - { - _eventAggregator.PublishEvent(new MediaCoversUpdatedEvent(message.Movie)); - } + + _eventAggregator.PublishEvent(new MediaCoversUpdatedEvent(message.Movie, updated)); } public void HandleAsync(MovieDeletedEvent message) diff --git a/src/NzbDrone.Core/MediaCover/MediaCoversUpdatedEvent.cs b/src/NzbDrone.Core/MediaCover/MediaCoversUpdatedEvent.cs index 3dc1832f9..ba0bf7a6f 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoversUpdatedEvent.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoversUpdatedEvent.cs @@ -6,10 +6,13 @@ namespace NzbDrone.Core.MediaCover public class MediaCoversUpdatedEvent : IEvent { public Movie Movie { get; set; } + public bool Updated { get; set; } - public MediaCoversUpdatedEvent(Movie movie) + + public MediaCoversUpdatedEvent(Movie movie, bool updated) { Movie = movie; + Updated = updated; } } } diff --git a/src/Radarr.Api.V3/Movies/MovieModule.cs b/src/Radarr.Api.V3/Movies/MovieModule.cs index ee4486ba2..21a267b61 100644 --- a/src/Radarr.Api.V3/Movies/MovieModule.cs +++ b/src/Radarr.Api.V3/Movies/MovieModule.cs @@ -219,7 +219,10 @@ public void Handle(MovieRenamedEvent message) public void Handle(MediaCoversUpdatedEvent message) { - BroadcastResourceChange(ModelAction.Updated, message.Movie.Id); + if (message.Updated) + { + BroadcastResourceChange(ModelAction.Updated, message.Movie.Id); + } } } }