1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Hopefully fixed bulk import not showing files.

This commit is contained in:
Leonardo Galli 2018-10-15 10:03:15 +02:00
parent e01900628f
commit 6c45c7db1b

View File

@ -14,6 +14,7 @@
using NzbDrone.Core.RootFolders; using NzbDrone.Core.RootFolders;
using NzbDrone.Common.Cache; using NzbDrone.Common.Cache;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Profiles;
namespace NzbDrone.Api.Movies namespace NzbDrone.Api.Movies
{ {
@ -34,12 +35,13 @@ public class MovieBulkImportModule : NzbDroneRestModule<MovieResource>
private readonly IDiskScanService _diskScanService; private readonly IDiskScanService _diskScanService;
private readonly ICached<Core.Movies.Movie> _mappedMovies; private readonly ICached<Core.Movies.Movie> _mappedMovies;
private readonly IParsingService _parsingService; private readonly IParsingService _parsingService;
private readonly IProfileService _profileService;
private readonly IMovieService _movieService; private readonly IMovieService _movieService;
public MovieBulkImportModule(ISearchForNewMovie searchProxy, IRootFolderService rootFolderService, public MovieBulkImportModule(ISearchForNewMovie searchProxy, IRootFolderService rootFolderService,
IMakeImportDecision importDecisionMaker, IMakeImportDecision importDecisionMaker,
IDiskScanService diskScanService, ICacheManager cacheManager, IDiskScanService diskScanService, ICacheManager cacheManager,
IParsingService parsingService, IMovieService movieService) IParsingService parsingService, IProfileService profileService, IMovieService movieService)
: base("/movies/bulkimport") : base("/movies/bulkimport")
{ {
_searchProxy = searchProxy; _searchProxy = searchProxy;
@ -48,6 +50,7 @@ public MovieBulkImportModule(ISearchForNewMovie searchProxy, IRootFolderService
_diskScanService = diskScanService; _diskScanService = diskScanService;
_mappedMovies = cacheManager.GetCache<Core.Movies.Movie>(GetType(), "mappedMoviesCache"); _mappedMovies = cacheManager.GetCache<Core.Movies.Movie>(GetType(), "mappedMoviesCache");
_movieService = movieService; _movieService = movieService;
_profileService = profileService;
_parsingService = parsingService; _parsingService = parsingService;
Get["/"] = x => Search(); Get["/"] = x => Search();
} }
@ -60,6 +63,8 @@ private Response Search()
//Todo error handling //Todo error handling
} }
Profile tempProfile = _profileService.All().First();
RootFolder rootFolder = _rootFolderService.Get(Request.Query.Id); RootFolder rootFolder = _rootFolderService.Get(Request.Query.Id);
int page = Request.Query.page; int page = Request.Query.page;
@ -100,6 +105,7 @@ private Response Search()
{ {
Title = f.Name.Replace(".", " ").Replace("-", " "), Title = f.Name.Replace(".", " ").Replace("-", " "),
Path = f.Path, Path = f.Path,
Profile = tempProfile
}; };
} }
else else
@ -111,7 +117,8 @@ private Response Search()
Title = parsedTitle.MovieTitle, Title = parsedTitle.MovieTitle,
Year = parsedTitle.Year, Year = parsedTitle.Year,
ImdbId = parsedTitle.ImdbId, ImdbId = parsedTitle.ImdbId,
Path = f.Path Path = f.Path,
Profile = tempProfile
}; };
} }