Fixed: Use originalFilePath in CF if scene name missing

pull/2/head
ta264 4 years ago committed by Qstick
parent 6706138fa0
commit e870fd5215

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Blacklisting;
@ -59,10 +60,24 @@ namespace NzbDrone.Core.CustomFormats
public static List<CustomFormat> ParseCustomFormat(MovieFile movieFile, List<CustomFormat> allCustomFormats)
{
var sceneName = string.Empty;
if (movieFile.SceneName.IsNotNullOrWhiteSpace())
{
sceneName = movieFile.SceneName;
}
else if (movieFile.OriginalFilePath.IsNotNullOrWhiteSpace())
{
sceneName = movieFile.OriginalFilePath;
}
else if (movieFile.RelativePath.IsNotNullOrWhiteSpace())
{
sceneName = Path.GetFileName(movieFile.RelativePath);
}
var info = new ParsedMovieInfo
{
MovieTitle = movieFile.Movie.Title,
SimpleReleaseTitle = movieFile.GetSceneOrFileName().SimplifyReleaseTitle(),
SimpleReleaseTitle = sceneName.SimplifyReleaseTitle(),
Quality = movieFile.Quality,
Languages = movieFile.Languages,
ReleaseGroup = movieFile.ReleaseGroup,

Loading…
Cancel
Save