mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-03 22:57:18 +02:00
Fixed: Map covers to local for Movie Editor
This commit is contained in:
parent
ada326e4dd
commit
04f792c55a
@ -5,6 +5,7 @@
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
using NzbDrone.Core.Movies;
|
||||
using NzbDrone.Core.Movies.Commands;
|
||||
@ -18,18 +19,21 @@ public class MovieEditorController : Controller
|
||||
{
|
||||
private readonly IMovieService _movieService;
|
||||
private readonly IMovieTranslationService _movieTranslationService;
|
||||
private readonly IMapCoversToLocal _coverMapper;
|
||||
private readonly IConfigService _configService;
|
||||
private readonly IManageCommandQueue _commandQueueManager;
|
||||
private readonly IUpgradableSpecification _upgradableSpecification;
|
||||
|
||||
public MovieEditorController(IMovieService movieService,
|
||||
IMovieTranslationService movieTranslationService,
|
||||
IMapCoversToLocal coverMapper,
|
||||
IConfigService configService,
|
||||
IManageCommandQueue commandQueueManager,
|
||||
IUpgradableSpecification upgradableSpecification)
|
||||
{
|
||||
_movieService = movieService;
|
||||
_movieTranslationService = movieTranslationService;
|
||||
_coverMapper = coverMapper;
|
||||
_configService = configService;
|
||||
_commandQueueManager = commandQueueManager;
|
||||
_upgradableSpecification = upgradableSpecification;
|
||||
@ -110,7 +114,11 @@ public IActionResult SaveAll([FromBody] MovieEditorResource resource)
|
||||
foreach (var movie in updatedMovies)
|
||||
{
|
||||
var translation = GetTranslationFromDict(tdict, movie.MovieMetadata, configLanguage);
|
||||
moviesResources.Add(movie.ToResource(availabilityDelay, translation, _upgradableSpecification));
|
||||
var movieResource = movie.ToResource(availabilityDelay, translation, _upgradableSpecification);
|
||||
|
||||
MapCoversToLocal(movieResource);
|
||||
|
||||
moviesResources.Add(movieResource);
|
||||
}
|
||||
|
||||
return Accepted(moviesResources);
|
||||
@ -146,5 +154,10 @@ private MovieTranslation GetTranslationFromDict(Dictionary<int, MovieTranslation
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
private void MapCoversToLocal(MovieResource movie)
|
||||
{
|
||||
_coverMapper.ConvertToLocalUrls(movie.Id, movie.Images);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user