Reimport files imported prematurely during script import
This commit is contained in:
parent
af5a681ab7
commit
7776ec9955
|
@ -23,13 +23,17 @@ namespace NzbDrone.Core.Extras
|
||||||
|
|
||||||
public virtual ImportExistingExtraFileFilterResult<TExtraFile> FilterAndClean(Series series, List<string> filesOnDisk, List<string> importedFiles, bool keepExistingEntries)
|
public virtual ImportExistingExtraFileFilterResult<TExtraFile> FilterAndClean(Series series, List<string> filesOnDisk, List<string> importedFiles, bool keepExistingEntries)
|
||||||
{
|
{
|
||||||
|
var seriesFiles = _extraFileService.GetFilesBySeries(series.Id);
|
||||||
|
|
||||||
if (keepExistingEntries)
|
if (keepExistingEntries)
|
||||||
{
|
{
|
||||||
|
var incompleteImports = seriesFiles.IntersectBy(f => Path.Combine(series.Path, f.RelativePath), filesOnDisk, i => i, PathEqualityComparer.Instance).Select(f => f.Id);
|
||||||
|
|
||||||
|
_extraFileService.DeleteMany(incompleteImports);
|
||||||
|
|
||||||
return Filter(series, filesOnDisk, importedFiles, new List<TExtraFile>());
|
return Filter(series, filesOnDisk, importedFiles, new List<TExtraFile>());
|
||||||
}
|
}
|
||||||
|
|
||||||
var seriesFiles = _extraFileService.GetFilesBySeries(series.Id);
|
|
||||||
|
|
||||||
Clean(series, filesOnDisk, importedFiles, seriesFiles);
|
Clean(series, filesOnDisk, importedFiles, seriesFiles);
|
||||||
|
|
||||||
return Filter(series, filesOnDisk, importedFiles, seriesFiles);
|
return Filter(series, filesOnDisk, importedFiles, seriesFiles);
|
||||||
|
|
Loading…
Reference in New Issue