Fixed: Don't fail on single failure for Discover bulk add

Fixes #7409
pull/7411/head
Qstick 2 years ago
parent 548e3400b5
commit 098a893083

@ -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.MediaCover;
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 @@ namespace Radarr.Api.V3.ImportLists
private readonly IConfigService _configService;
public ImportListMoviesController(IMovieService movieService,
IAddMovieService addMovieService,
IProvideMovieInfo movieInfo,
IBuildFileNames fileNameBuilder,
IImportListMovieService listMovieService,
@ -37,6 +40,7 @@ namespace Radarr.Api.V3.ImportLists
IConfigService configService)
{
_movieService = movieService;
_addMovieService = addMovieService;
_movieInfo = movieInfo;
_fileNameBuilder = fileNameBuilder;
_listMovieService = listMovieService;
@ -92,6 +96,14 @@ namespace Radarr.Api.V3.ImportLists
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…
Cancel
Save