1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 01:42:35 +01:00

Reimport files imported prematurely during script import

(cherry picked from commit 7776ec995571a6bc3ff1a35bbede02c05b943063)
This commit is contained in:
Jendrik Weise 2024-03-26 15:25:23 +01:00 committed by Bogdan
parent 0a9ae45ed1
commit fcb758bf67

View File

@ -23,13 +23,17 @@ public ImportExistingExtraFilesBase(IExtraFileService<TExtraFile> extraFileServi
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);