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.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 @@ namespace Radarr.Api.V3.Calendar
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;

@ -7,6 +7,7 @@ using NzbDrone.Core.Datastore.Events;
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 @@ namespace Radarr.Api.V3.Movies
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 @@ namespace Radarr.Api.V3.Movies
IUpgradableSpecification upgradableSpecification,
ICustomFormatCalculationService formatCalculator,
IConfigService configService,
IMapCoversToLocal coverMapper,
IBroadcastSignalRMessage signalRBroadcaster)
: base(signalRBroadcaster)
{
@ -44,6 +47,7 @@ namespace Radarr.Api.V3.Movies
_upgradableSpecification = upgradableSpecification;
_formatCalculator = formatCalculator;
_configService = configService;
_coverMapper = coverMapper;
}
protected MovieControllerWithSignalR(IMovieService movieService,
@ -81,6 +85,8 @@ namespace Radarr.Api.V3.Movies
var resource = movie.ToResource(availDelay, translation, _upgradableSpecification, _formatCalculator);
FetchAndLinkMovieStatistics(resource);
_coverMapper.ConvertToLocalUrls(resource.Id, resource.Images);
return resource;
}
@ -138,7 +144,7 @@ namespace Radarr.Api.V3.Movies
[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);

@ -4,6 +4,7 @@ using NzbDrone.Core.Configuration;
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 @@ namespace Radarr.Api.V3.Wanted
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;
}

@ -4,6 +4,7 @@ using NzbDrone.Core.Configuration;
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 @@ namespace Radarr.Api.V3.Wanted
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)
{
}

Loading…
Cancel
Save