diff --git a/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs b/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs index f4683ed1a..c3327a72b 100644 --- a/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs +++ b/src/NzbDrone.Core/Extras/ImportExistingExtraFilesBase.cs @@ -23,13 +23,17 @@ namespace NzbDrone.Core.Extras public virtual ImportExistingExtraFileFilterResult FilterAndClean(Movie movie, List filesOnDisk, List 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()); } - var movieFiles = _extraFileService.GetFilesByMovie(movie.Id); - Clean(movie, filesOnDisk, importedFiles, movieFiles); return Filter(movie, filesOnDisk, importedFiles, movieFiles);