mirror of
https://github.com/Radarr/Radarr
synced 2025-02-28 08:55:51 +00:00
Fixed: Use Orignal Filename token for renaming as only token
This commit is contained in:
parent
2b1f6b2711
commit
7f27507ef6
1 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ public static class FileNameValidation
|
||||||
private static readonly Regex SeasonFolderRegex = new Regex(@"(\{season(\:\d+)?\})",
|
private static readonly Regex SeasonFolderRegex = new Regex(@"(\{season(\:\d+)?\})",
|
||||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
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);
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
public static IRuleBuilderOptions<T, string> ValidEpisodeFormat<T>(this IRuleBuilder<T, string> ruleBuilder)
|
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;
|
var value = context.PropertyValue as String;
|
||||||
|
|
||||||
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
|
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
|
||||||
!FileNameValidation.OriginalTitleRegex.IsMatch(value))
|
!FileNameValidation.OriginalTokenRegex.IsMatch(value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ protected override bool IsValid(PropertyValidatorContext context)
|
||||||
|
|
||||||
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
|
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
|
||||||
!FileNameBuilder.AirDateRegex.IsMatch(value) &&
|
!FileNameBuilder.AirDateRegex.IsMatch(value) &&
|
||||||
!FileNameValidation.OriginalTitleRegex.IsMatch(value))
|
!FileNameValidation.OriginalTokenRegex.IsMatch(value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ protected override bool IsValid(PropertyValidatorContext context)
|
||||||
|
|
||||||
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
|
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
|
||||||
!FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) &&
|
!FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) &&
|
||||||
!FileNameValidation.OriginalTitleRegex.IsMatch(value))
|
!FileNameValidation.OriginalTokenRegex.IsMatch(value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue