diff --git a/NzbDrone.Core.Test/TvDbProviderTest.cs b/NzbDrone.Core.Test/TvDbProviderTest.cs index 6df4a4246..8b35335c4 100644 --- a/NzbDrone.Core.Test/TvDbProviderTest.cs +++ b/NzbDrone.Core.Test/TvDbProviderTest.cs @@ -85,7 +85,7 @@ public void American_dad_fix() } //assert - seasonsNumbers.Should().HaveCount(7); + seasonsNumbers.Should().HaveCount(8); seasons[1].Should().HaveCount(23); seasons[2].Should().HaveCount(19); seasons[3].Should().HaveCount(16); diff --git a/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs b/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs index f1564425c..0e80a24f1 100644 --- a/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs +++ b/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs @@ -84,6 +84,10 @@ public virtual void Start(ProgressNotification notification, int targetId) var importedFiles = _diskScanProvider.Scan(series, subfolder); 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"); diff --git a/NzbDrone.Web/Controllers/AddSeriesController.cs b/NzbDrone.Web/Controllers/AddSeriesController.cs index cfd14816d..a2b0d3268 100644 --- a/NzbDrone.Web/Controllers/AddSeriesController.cs +++ b/NzbDrone.Web/Controllers/AddSeriesController.cs @@ -54,7 +54,7 @@ public ActionResult AddNew() { Path = r.Path, CleanPath = r.Path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`') - }).ToList(); + }); ViewData["RootDirs"] = rootDirs; ViewData["DirSep"] = Path.DirectorySeparatorChar.ToString().Replace(Path.DirectorySeparatorChar, '|');