mirror of
https://github.com/Radarr/Radarr
synced 2025-02-23 23:01:10 +00:00
parent
548e3400b5
commit
098a893083
2 changed files with 13 additions and 1 deletions
|
@ -561,7 +561,7 @@ export const actionHandlers = handleThunks({
|
|||
}, []);
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/movie/import',
|
||||
url: '/importlist/movie',
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(allNewMovies)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
using NzbDrone.Core.MetadataSource;
|
||||
using NzbDrone.Core.Movies;
|
||||
using NzbDrone.Core.Organizer;
|
||||
using Radarr.Api.V3.Movies;
|
||||
using Radarr.Http;
|
||||
|
||||
namespace Radarr.Api.V3.ImportLists
|
||||
|
@ -19,6 +20,7 @@ namespace Radarr.Api.V3.ImportLists
|
|||
public class ImportListMoviesController : Controller
|
||||
{
|
||||
private readonly IMovieService _movieService;
|
||||
private readonly IAddMovieService _addMovieService;
|
||||
private readonly IProvideMovieInfo _movieInfo;
|
||||
private readonly IBuildFileNames _fileNameBuilder;
|
||||
private readonly IImportListMovieService _listMovieService;
|
||||
|
@ -28,6 +30,7 @@ public class ImportListMoviesController : Controller
|
|||
private readonly IConfigService _configService;
|
||||
|
||||
public ImportListMoviesController(IMovieService movieService,
|
||||
IAddMovieService addMovieService,
|
||||
IProvideMovieInfo movieInfo,
|
||||
IBuildFileNames fileNameBuilder,
|
||||
IImportListMovieService listMovieService,
|
||||
|
@ -37,6 +40,7 @@ public ImportListMoviesController(IMovieService movieService,
|
|||
IConfigService configService)
|
||||
{
|
||||
_movieService = movieService;
|
||||
_addMovieService = addMovieService;
|
||||
_movieInfo = movieInfo;
|
||||
_fileNameBuilder = fileNameBuilder;
|
||||
_listMovieService = listMovieService;
|
||||
|
@ -92,6 +96,14 @@ public object GetDiscoverMovies(bool includeRecommendations = false)
|
|||
return realResults;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public object AddMovies([FromBody] List<MovieResource> resource)
|
||||
{
|
||||
var newMovies = resource.ToModel();
|
||||
|
||||
return _addMovieService.AddMovies(newMovies, true).ToResource(0);
|
||||
}
|
||||
|
||||
private IEnumerable<ImportListMoviesResource> MapToResource(IEnumerable<Movie> movies, Language language)
|
||||
{
|
||||
//Avoid calling for naming spec on every movie in filenamebuilder
|
||||
|
|
Loading…
Reference in a new issue