From 422371d11859912adede7f25d281c10c8976eb3c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 29 Aug 2016 21:22:25 -0700 Subject: [PATCH] Fixed: Episode import when the series folder had a trailing slash and folder was not on disk --- src/NzbDrone.Common.Test/OsPathFixture.cs | 1 + src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common.Test/OsPathFixture.cs b/src/NzbDrone.Common.Test/OsPathFixture.cs index 82af442f7..cadd01831 100644 --- a/src/NzbDrone.Common.Test/OsPathFixture.cs +++ b/src/NzbDrone.Common.Test/OsPathFixture.cs @@ -58,6 +58,7 @@ namespace NzbDrone.Common.Test } [TestCase(@"C:\rooted\windows\path", @"C:\rooted\windows\")] + [TestCase(@"C:\rooted\windows\path\", @"C:\rooted\windows\")] [TestCase(@"C:\rooted", @"C:\")] [TestCase(@"C:", null)] [TestCase("/rooted/linux/path", "/rooted/linux/")] diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index 781d6e4cf..44bfcd8ad 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -153,7 +153,7 @@ namespace NzbDrone.Core.MediaFiles var episodeFolder = Path.GetDirectoryName(filePath); var seasonFolder = _buildFileNames.BuildSeasonPath(series, seasonNumber); var seriesFolder = series.Path; - var rootFolder = Path.GetDirectoryName(seriesFolder); + var rootFolder = new OsPath(seriesFolder).Directory.FullPath; if (!_diskProvider.FolderExists(rootFolder)) {