From 7f27507ef6056e8a30c5c6eaef6377284933b37f Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 21 Jan 2015 11:26:47 -0800 Subject: [PATCH] Fixed: Use Orignal Filename token for renaming as only token --- src/NzbDrone.Core/Organizer/FileNameValidation.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Organizer/FileNameValidation.cs b/src/NzbDrone.Core/Organizer/FileNameValidation.cs index 52bc92eb6..c59151ae6 100644 --- a/src/NzbDrone.Core/Organizer/FileNameValidation.cs +++ b/src/NzbDrone.Core/Organizer/FileNameValidation.cs @@ -10,7 +10,7 @@ public static class FileNameValidation private static readonly Regex SeasonFolderRegex = new Regex(@"(\{season(\:\d+)?\})", RegexOptions.Compiled | RegexOptions.IgnoreCase); - internal static readonly Regex OriginalTitleRegex = new Regex(@"(\{original[- ._]title\})", + internal static readonly Regex OriginalTokenRegex = new Regex(@"(\{original[- ._](?:title|filename)\})", RegexOptions.Compiled | RegexOptions.IgnoreCase); public static IRuleBuilderOptions ValidEpisodeFormat(this IRuleBuilder ruleBuilder) @@ -57,7 +57,7 @@ protected override bool IsValid(PropertyValidatorContext context) var value = context.PropertyValue as String; if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && - !FileNameValidation.OriginalTitleRegex.IsMatch(value)) + !FileNameValidation.OriginalTokenRegex.IsMatch(value)) { return false; } @@ -80,7 +80,7 @@ protected override bool IsValid(PropertyValidatorContext context) if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AirDateRegex.IsMatch(value) && - !FileNameValidation.OriginalTitleRegex.IsMatch(value)) + !FileNameValidation.OriginalTokenRegex.IsMatch(value)) { return false; } @@ -103,7 +103,7 @@ protected override bool IsValid(PropertyValidatorContext context) if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) && - !FileNameValidation.OriginalTitleRegex.IsMatch(value)) + !FileNameValidation.OriginalTokenRegex.IsMatch(value)) { return false; }