diff --git a/src/Radarr.Api.V3/Calendar/CalendarController.cs b/src/Radarr.Api.V3/Calendar/CalendarController.cs index 196193d91..79bce2e4b 100644 --- a/src/Radarr.Api.V3/Calendar/CalendarController.cs +++ b/src/Radarr.Api.V3/Calendar/CalendarController.cs @@ -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; diff --git a/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs b/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs index 455ce6b4c..28b2bdb92 100644 --- a/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs +++ b/src/Radarr.Api.V3/Movies/MovieControllerWithSignalR.cs @@ -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); diff --git a/src/Radarr.Api.V3/Wanted/CutoffController.cs b/src/Radarr.Api.V3/Wanted/CutoffController.cs index 4b8162cd9..271ad2003 100644 --- a/src/Radarr.Api.V3/Wanted/CutoffController.cs +++ b/src/Radarr.Api.V3/Wanted/CutoffController.cs @@ -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; } diff --git a/src/Radarr.Api.V3/Wanted/MissingController.cs b/src/Radarr.Api.V3/Wanted/MissingController.cs index 6f5075287..e0376f07e 100644 --- a/src/Radarr.Api.V3/Wanted/MissingController.cs +++ b/src/Radarr.Api.V3/Wanted/MissingController.cs @@ -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) { }