mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-25 17:17:02 +00:00
Remove empty folders after importing new downloads.
Fixed American Dad test (new season added to TheTvDb). Removed unneeded .ToList()
This commit is contained in:
parent
d2a0e315b2
commit
87e9589761
3 changed files with 6 additions and 2 deletions
|
@ -85,7 +85,7 @@ public void American_dad_fix()
|
||||||
}
|
}
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
seasonsNumbers.Should().HaveCount(7);
|
seasonsNumbers.Should().HaveCount(8);
|
||||||
seasons[1].Should().HaveCount(23);
|
seasons[1].Should().HaveCount(23);
|
||||||
seasons[2].Should().HaveCount(19);
|
seasons[2].Should().HaveCount(19);
|
||||||
seasons[3].Should().HaveCount(16);
|
seasons[3].Should().HaveCount(16);
|
||||||
|
|
|
@ -84,6 +84,10 @@ public virtual void Start(ProgressNotification notification, int targetId)
|
||||||
|
|
||||||
var importedFiles = _diskScanProvider.Scan(series, subfolder);
|
var importedFiles = _diskScanProvider.Scan(series, subfolder);
|
||||||
importedFiles.ForEach(file => _diskScanProvider.MoveEpisodeFile(file));
|
importedFiles.ForEach(file => _diskScanProvider.MoveEpisodeFile(file));
|
||||||
|
|
||||||
|
//Delete the folder only if all files were removed
|
||||||
|
if (_diskProvider.GetFiles(subfolder, "*.*", SearchOption.AllDirectories).Length == 0)
|
||||||
|
_diskProvider.DeleteFolder(subfolder, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Debug("New Download Scan Job completed successfully");
|
Logger.Debug("New Download Scan Job completed successfully");
|
||||||
|
|
|
@ -54,7 +54,7 @@ public ActionResult AddNew()
|
||||||
{
|
{
|
||||||
Path = r.Path,
|
Path = r.Path,
|
||||||
CleanPath = r.Path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`')
|
CleanPath = r.Path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`')
|
||||||
}).ToList();
|
});
|
||||||
ViewData["RootDirs"] = rootDirs;
|
ViewData["RootDirs"] = rootDirs;
|
||||||
ViewData["DirSep"] = Path.DirectorySeparatorChar.ToString().Replace(Path.DirectorySeparatorChar, '|');
|
ViewData["DirSep"] = Path.DirectorySeparatorChar.ToString().Replace(Path.DirectorySeparatorChar, '|');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue