1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-26 04:33:01 +01:00

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

View File

@ -155,13 +155,14 @@ namespace NzbDrone.Core.CustomFormats
private static List<CustomFormat> ParseCustomFormat(EpisodeFile episodeFile, Series series, List<CustomFormat> 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())
{