Improve CF calculation for files without scene name

Fixed: Use original filename instead of complete path when calculating CF for existing file without scene name
Closes #5365
This commit is contained in:
Mark McDowall 2023-02-12 22:33:45 -08:00
parent 2c65e4fa41
commit 997aabbc3c
1 changed files with 2 additions and 1 deletions

View File

@ -155,13 +155,14 @@ namespace NzbDrone.Core.CustomFormats
private static List<CustomFormat> ParseCustomFormat(EpisodeFile episodeFile, Series series, List<CustomFormat> allCustomFormats) private static List<CustomFormat> ParseCustomFormat(EpisodeFile episodeFile, Series series, List<CustomFormat> allCustomFormats)
{ {
var sceneName = string.Empty; var sceneName = string.Empty;
if (episodeFile.SceneName.IsNotNullOrWhiteSpace()) if (episodeFile.SceneName.IsNotNullOrWhiteSpace())
{ {
sceneName = episodeFile.SceneName; sceneName = episodeFile.SceneName;
} }
else if (episodeFile.OriginalFilePath.IsNotNullOrWhiteSpace()) else if (episodeFile.OriginalFilePath.IsNotNullOrWhiteSpace())
{ {
sceneName = episodeFile.OriginalFilePath; sceneName = Path.GetFileName(episodeFile.OriginalFilePath);
} }
else if (episodeFile.RelativePath.IsNotNullOrWhiteSpace()) else if (episodeFile.RelativePath.IsNotNullOrWhiteSpace())
{ {