From a39cafe404210f64be4a399f9efa9b6ef442383a 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 (cherry picked from commit 997aabbc3cfc3c9c5c220786d1d08cfceec5e2f2) Closes #8115 --- .../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 da33b0156e..892d28517f 100644 --- a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs +++ b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs @@ -168,13 +168,14 @@ private static List ParseCustomFormat(CustomFormatInput input, Lis private static List ParseCustomFormat(MovieFile movieFile, Movie movie, List allCustomFormats) { var releaseTitle = string.Empty; + if (movieFile.SceneName.IsNotNullOrWhiteSpace()) { releaseTitle = movieFile.SceneName; } else if (movieFile.OriginalFilePath.IsNotNullOrWhiteSpace()) { - releaseTitle = movieFile.OriginalFilePath; + releaseTitle = Path.GetFileName(movieFile.OriginalFilePath); } else if (movieFile.RelativePath.IsNotNullOrWhiteSpace()) {