|
|
@ -20,6 +20,7 @@ using NzbDrone.Core.Movies;
|
|
|
|
using NzbDrone.Core.Movies.Commands;
|
|
|
|
using NzbDrone.Core.Movies.Commands;
|
|
|
|
using NzbDrone.Core.Movies.Events;
|
|
|
|
using NzbDrone.Core.Movies.Events;
|
|
|
|
using NzbDrone.Core.Movies.Translations;
|
|
|
|
using NzbDrone.Core.Movies.Translations;
|
|
|
|
|
|
|
|
using NzbDrone.Core.RootFolders;
|
|
|
|
using NzbDrone.Core.Validation;
|
|
|
|
using NzbDrone.Core.Validation;
|
|
|
|
using NzbDrone.Core.Validation.Paths;
|
|
|
|
using NzbDrone.Core.Validation.Paths;
|
|
|
|
using NzbDrone.SignalR;
|
|
|
|
using NzbDrone.SignalR;
|
|
|
@ -45,6 +46,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
private readonly IAddMovieService _addMovieService;
|
|
|
|
private readonly IAddMovieService _addMovieService;
|
|
|
|
private readonly IMapCoversToLocal _coverMapper;
|
|
|
|
private readonly IMapCoversToLocal _coverMapper;
|
|
|
|
private readonly IManageCommandQueue _commandQueueManager;
|
|
|
|
private readonly IManageCommandQueue _commandQueueManager;
|
|
|
|
|
|
|
|
private readonly IRootFolderService _rootFolderService;
|
|
|
|
private readonly IUpgradableSpecification _qualityUpgradableSpecification;
|
|
|
|
private readonly IUpgradableSpecification _qualityUpgradableSpecification;
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
@ -55,6 +57,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
IAddMovieService addMovieService,
|
|
|
|
IAddMovieService addMovieService,
|
|
|
|
IMapCoversToLocal coverMapper,
|
|
|
|
IMapCoversToLocal coverMapper,
|
|
|
|
IManageCommandQueue commandQueueManager,
|
|
|
|
IManageCommandQueue commandQueueManager,
|
|
|
|
|
|
|
|
IRootFolderService rootFolderService,
|
|
|
|
IUpgradableSpecification qualityUpgradableSpecification,
|
|
|
|
IUpgradableSpecification qualityUpgradableSpecification,
|
|
|
|
IConfigService configService,
|
|
|
|
IConfigService configService,
|
|
|
|
RootFolderValidator rootFolderValidator,
|
|
|
|
RootFolderValidator rootFolderValidator,
|
|
|
@ -76,6 +79,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
_configService = configService;
|
|
|
|
_configService = configService;
|
|
|
|
_coverMapper = coverMapper;
|
|
|
|
_coverMapper = coverMapper;
|
|
|
|
_commandQueueManager = commandQueueManager;
|
|
|
|
_commandQueueManager = commandQueueManager;
|
|
|
|
|
|
|
|
_rootFolderService = rootFolderService;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
|
|
SharedValidator.RuleFor(s => s.QualityProfileId).ValidId();
|
|
|
|
SharedValidator.RuleFor(s => s.QualityProfileId).ValidId();
|
|
|
@ -145,6 +149,10 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MapCoversToLocal(moviesResources, coverFileInfos);
|
|
|
|
MapCoversToLocal(moviesResources, coverFileInfos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rootFolders = _rootFolderService.All();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
moviesResources.ForEach(m => m.RootFolderPath = _rootFolderService.GetBestRootFolderPath(m.Path, rootFolders));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return moviesResources;
|
|
|
|
return moviesResources;
|
|
|
@ -171,6 +179,8 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
var resource = movie.ToResource(availDelay, translation, _qualityUpgradableSpecification);
|
|
|
|
var resource = movie.ToResource(availDelay, translation, _qualityUpgradableSpecification);
|
|
|
|
MapCoversToLocal(resource);
|
|
|
|
MapCoversToLocal(resource);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resource.RootFolderPath = _rootFolderService.GetBestRootFolderPath(resource.Path);
|
|
|
|
|
|
|
|
|
|
|
|
return resource;
|
|
|
|
return resource;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|