Fixed: Map covers to local for grabbed movies

pull/10076/head
Bogdan 7 months ago
parent a8eea20d69
commit bd905567de

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

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

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

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

Loading…
Cancel
Save