Reimport files imported prematurely during script import

(cherry picked from commit 7776ec995571a6bc3ff1a35bbede02c05b943063)
pull/9399/merge
Jendrik Weise 8 months ago committed by Bogdan
parent 0a9ae45ed1
commit fcb758bf67

@ -23,13 +23,17 @@ namespace NzbDrone.Core.Extras
public virtual ImportExistingExtraFileFilterResult<TExtraFile> FilterAndClean(Movie movie, List<string> filesOnDisk, List<string> importedFiles, bool keepExistingEntries)
{
var movieFiles = _extraFileService.GetFilesByMovie(movie.Id);
if (keepExistingEntries)
{
var incompleteImports = movieFiles.IntersectBy(f => Path.Combine(movie.Path, f.RelativePath), filesOnDisk, i => i, PathEqualityComparer.Instance).Select(f => f.Id);
_extraFileService.DeleteMany(incompleteImports);
return Filter(movie, filesOnDisk, importedFiles, new List<TExtraFile>());
}
var movieFiles = _extraFileService.GetFilesByMovie(movie.Id);
Clean(movie, filesOnDisk, importedFiles, movieFiles);
return Filter(movie, filesOnDisk, importedFiles, movieFiles);

Loading…
Cancel
Save