Fixed: Using folder as scene name for season packs

This commit is contained in:
Mark McDowall 2020-12-06 11:33:56 -08:00
parent dafcba7336
commit c5c0462258
2 changed files with 19 additions and 2 deletions

View File

@ -259,6 +259,22 @@ namespace NzbDrone.Core.Test.MediaFiles
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<EpisodeFile>(c => c.SceneName == null)));
}
[Test]
public void should_not_use_folder_name_as_scenename_if_it_is_for_a_full_season()
{
GivenNewDownload();
_approvedDecisions.First().LocalEpisode.Path = Path.Combine(_downloadClientItem.OutputPath.ToString(), "aaaaa.mkv");
_approvedDecisions.First().LocalEpisode.FolderEpisodeInfo = new ParsedEpisodeInfo
{
ReleaseTitle = "series.title.s02.dvdrip.xvid-ingot.mkv",
FullSeason = true
};
Subject.Import(new List<ImportDecision> { _approvedDecisions.First() }, true);
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<EpisodeFile>(c => c.SceneName == null)));
}
[Test]
public void should_import_larger_files_first()
{
@ -467,6 +483,5 @@ namespace NzbDrone.Core.Test.MediaFiles
Mocker.GetMock<IMediaFileService>().Verify(v => v.Add(It.Is<EpisodeFile>(c => c.OriginalFilePath == $"{name}\\subfolder\\{name}.mkv".AsOsAgnostic())));
}
}
}

View File

@ -220,7 +220,9 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
var folderTitle = localEpisode.FolderEpisodeInfo?.ReleaseTitle;
if (folderTitle.IsNotNullOrWhiteSpace() && SceneChecker.IsSceneTitle(folderTitle))
if (localEpisode.FolderEpisodeInfo?.FullSeason == false &&
folderTitle.IsNotNullOrWhiteSpace() &&
SceneChecker.IsSceneTitle(folderTitle))
{
return folderTitle;
}