mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
Fixed: Use Orignal Filename token for renaming as only token
This commit is contained in:
parent
2b1f6b2711
commit
7f27507ef6
@ -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<T, string> ValidEpisodeFormat<T>(this IRuleBuilder<T, string> 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user