diff --git a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs index d9860e509..6257ae0b8 100644 --- a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs +++ b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Core.Blocklisting; using NzbDrone.Core.History; @@ -25,10 +26,12 @@ namespace NzbDrone.Core.CustomFormats public class CustomFormatCalculationService : ICustomFormatCalculationService { private readonly ICustomFormatService _formatService; + private readonly Logger _logger; - public CustomFormatCalculationService(ICustomFormatService formatService) + public CustomFormatCalculationService(ICustomFormatService formatService, Logger logger) { _formatService = formatService; + _logger = logger; } public List ParseCustomFormat(RemoteMovie remoteMovie, long size) @@ -165,20 +168,23 @@ namespace NzbDrone.Core.CustomFormats return matches.OrderBy(x => x.Name).ToList(); } - private static List ParseCustomFormat(MovieFile movieFile, Movie movie, List allCustomFormats) + private List ParseCustomFormat(MovieFile movieFile, Movie movie, List allCustomFormats) { var releaseTitle = string.Empty; if (movieFile.SceneName.IsNotNullOrWhiteSpace()) { + _logger.Trace("Using scene name for release title: {0}", movieFile.SceneName); releaseTitle = movieFile.SceneName; } else if (movieFile.OriginalFilePath.IsNotNullOrWhiteSpace()) { + _logger.Trace("Using original file path for release title: {0}", Path.GetFileName(movieFile.OriginalFilePath)); releaseTitle = Path.GetFileName(movieFile.OriginalFilePath); } else if (movieFile.RelativePath.IsNotNullOrWhiteSpace()) { + _logger.Trace("Using relative path for release title: {0}", Path.GetFileName(movieFile.RelativePath)); releaseTitle = Path.GetFileName(movieFile.RelativePath); }