From 997aabbc3cfc3c9c5c220786d1d08cfceec5e2f2 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 12 Feb 2023 22:33:45 -0800 Subject: [PATCH] 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 --- .../CustomFormats/CustomFormatCalculationService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs index 697420132..2848027f2 100644 --- a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs +++ b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs @@ -155,13 +155,14 @@ namespace NzbDrone.Core.CustomFormats private static List ParseCustomFormat(EpisodeFile episodeFile, Series series, List allCustomFormats) { var sceneName = string.Empty; + if (episodeFile.SceneName.IsNotNullOrWhiteSpace()) { sceneName = episodeFile.SceneName; } else if (episodeFile.OriginalFilePath.IsNotNullOrWhiteSpace()) { - sceneName = episodeFile.OriginalFilePath; + sceneName = Path.GetFileName(episodeFile.OriginalFilePath); } else if (episodeFile.RelativePath.IsNotNullOrWhiteSpace()) {