1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-16 16:04:08 +01:00

Fixed: Map covers to local for grabbed movies

This commit is contained in:
Bogdan 2024-06-10 14:23:55 +03:00
parent a8eea20d69
commit bd905567de
4 changed files with 16 additions and 4 deletions

View File

@ -6,6 +6,7 @@
using NzbDrone.Core.Configuration;
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Translations;
using NzbDrone.Core.MovieStats;
@ -29,8 +30,9 @@ public CalendarController(IBroadcastSignalRMessage signalR,
IUpgradableSpecification upgradableSpecification,
ICustomFormatCalculationService formatCalculator,
ITagService tagService,
IMapCoversToLocal coverMapper,
IConfigService configService)
: base(movieService, movieTranslationService, movieStatisticsService, upgradableSpecification, formatCalculator, configService, signalR)
: base(movieService, movieTranslationService, movieStatisticsService, upgradableSpecification, formatCalculator, configService, coverMapper, signalR)
{
_moviesService = movieService;
_tagService = tagService;

View File

@ -7,6 +7,7 @@
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Download;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Movies;
@ -28,6 +29,7 @@ public abstract class MovieControllerWithSignalR : RestControllerWithSignalR<Mov
protected readonly IUpgradableSpecification _upgradableSpecification;
protected readonly ICustomFormatCalculationService _formatCalculator;
protected readonly IConfigService _configService;
protected readonly IMapCoversToLocal _coverMapper;
protected MovieControllerWithSignalR(IMovieService movieService,
IMovieTranslationService movieTranslationService,
@ -35,6 +37,7 @@ protected MovieControllerWithSignalR(IMovieService movieService,
IUpgradableSpecification upgradableSpecification,
ICustomFormatCalculationService formatCalculator,
IConfigService configService,
IMapCoversToLocal coverMapper,
IBroadcastSignalRMessage signalRBroadcaster)
: base(signalRBroadcaster)
{
@ -44,6 +47,7 @@ protected MovieControllerWithSignalR(IMovieService movieService,
_upgradableSpecification = upgradableSpecification;
_formatCalculator = formatCalculator;
_configService = configService;
_coverMapper = coverMapper;
}
protected MovieControllerWithSignalR(IMovieService movieService,
@ -81,6 +85,8 @@ protected MovieResource MapToResource(Movie movie)
var resource = movie.ToResource(availDelay, translation, _upgradableSpecification, _formatCalculator);
FetchAndLinkMovieStatistics(resource);
_coverMapper.ConvertToLocalUrls(resource.Id, resource.Images);
return resource;
}
@ -138,7 +144,7 @@ private void LinkMovieStatistics(MovieResource resource, MovieStatistics movieSt
[NonAction]
public void Handle(MovieGrabbedEvent message)
{
var resource = message.Movie.Movie.ToResource(0, null, _upgradableSpecification, _formatCalculator);
var resource = MapToResource(message.Movie.Movie);
resource.Grabbed = true;
BroadcastResourceChange(ModelAction.Updated, resource);

View File

@ -4,6 +4,7 @@
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Translations;
using NzbDrone.Core.MovieStats;
@ -26,8 +27,9 @@ public CutoffController(IMovieCutoffService movieCutoffService,
IUpgradableSpecification upgradableSpecification,
ICustomFormatCalculationService formatCalculator,
IConfigService configService,
IMapCoversToLocal coverMapper,
IBroadcastSignalRMessage signalRBroadcaster)
: base(movieService, movieTranslationService, movieStatisticsService, upgradableSpecification, formatCalculator, configService, signalRBroadcaster)
: base(movieService, movieTranslationService, movieStatisticsService, upgradableSpecification, formatCalculator, configService, coverMapper, signalRBroadcaster)
{
_movieCutoffService = movieCutoffService;
}

View File

@ -4,6 +4,7 @@
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Translations;
using NzbDrone.Core.MovieStats;
@ -23,8 +24,9 @@ public MissingController(IMovieService movieService,
IUpgradableSpecification upgradableSpecification,
ICustomFormatCalculationService formatCalculator,
IConfigService configService,
IMapCoversToLocal coverMapper,
IBroadcastSignalRMessage signalRBroadcaster)
: base(movieService, movieTranslationService, movieStatisticsService, upgradableSpecification, formatCalculator, configService, signalRBroadcaster)
: base(movieService, movieTranslationService, movieStatisticsService, upgradableSpecification, formatCalculator, configService, coverMapper, signalRBroadcaster)
{
}