mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed: Trigger fewer signalr broadcasts
This commit is contained in:
parent
8e256462bf
commit
5b07046396
@ -90,6 +90,7 @@ private string GetMovieCoverPath(int movieId)
|
||||
|
||||
private void EnsureCovers(Movie movie)
|
||||
{
|
||||
bool updated = false;
|
||||
var toResize = new List<Tuple<MediaCover, bool>>();
|
||||
|
||||
foreach (var cover in movie.Images)
|
||||
@ -102,6 +103,7 @@ private void EnsureCovers(Movie movie)
|
||||
if (!alreadyExists)
|
||||
{
|
||||
DownloadCover(movie, cover);
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
catch (WebException e)
|
||||
@ -129,6 +131,8 @@ private void EnsureCovers(Movie movie)
|
||||
{
|
||||
_semaphore.Release();
|
||||
}
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
private void DownloadCover(Movie movie, MediaCover cover)
|
||||
@ -186,8 +190,11 @@ private void EnsureResizedCovers(Movie movie, MediaCover cover, bool forceResize
|
||||
|
||||
public void HandleAsync(MovieUpdatedEvent message)
|
||||
{
|
||||
EnsureCovers(message.Movie);
|
||||
_eventAggregator.PublishEvent(new MediaCoversUpdatedEvent(message.Movie));
|
||||
var updated = EnsureCovers(message.Movie);
|
||||
if (updated)
|
||||
{
|
||||
_eventAggregator.PublishEvent(new MediaCoversUpdatedEvent(message.Movie));
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAsync(MovieDeletedEvent message)
|
||||
|
@ -136,7 +136,7 @@ private void RefreshMovieInfo(Movie movie)
|
||||
_logger.Info(ex, "Unable to communicate with Mappings Server.");
|
||||
}
|
||||
|
||||
_movieService.UpdateMovie(movie);
|
||||
_movieService.UpdateMovie(new List<Movie> { movie });
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user