Match using directory names in ExtraResolver
This commit is contained in:
parent
cc8294842a
commit
2e1ec2858a
|
@ -505,7 +505,15 @@ namespace Emby.Naming.Common
|
|||
RuleType = ExtraRuleType.Suffix,
|
||||
Token = "-short",
|
||||
MediaType = MediaType.Video
|
||||
}
|
||||
},
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.BehindTheScenes, Token = "behind the scenes" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.DeletedScene, Token = "deleted scenes" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.Interview, Token = "interviews" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.Scene, Token = "scenes" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.Sample, Token = "samples" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.Clip, Token = "shorts" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.Clip, Token = "featurettes" },
|
||||
new ExtraRule { RuleType = ExtraRuleType.DirectoryName, MediaType = MediaType.Video, ExtraType = ExtraType.Unknown, Token = "extras" },
|
||||
};
|
||||
|
||||
Format3DRules = new[]
|
||||
|
|
|
@ -80,6 +80,15 @@ namespace Emby.Naming.Video
|
|||
result.Rule = rule;
|
||||
}
|
||||
}
|
||||
else if (rule.RuleType == ExtraRuleType.DirectoryName)
|
||||
{
|
||||
var directoryName = Path.GetFileName(Path.GetDirectoryName(path));
|
||||
if (string.Equals(directoryName, rule.Token, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
result.ExtraType = rule.ExtraType;
|
||||
result.Rule = rule;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -5,18 +5,23 @@ namespace Emby.Naming.Video
|
|||
public enum ExtraRuleType
|
||||
{
|
||||
/// <summary>
|
||||
/// The suffix
|
||||
/// Match <see cref="ExtraRule.Token"/> against a suffix in the file name.
|
||||
/// </summary>
|
||||
Suffix = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The filename
|
||||
/// Match <see cref="ExtraRule.Token"/> against the file name.
|
||||
/// </summary>
|
||||
Filename = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The regex
|
||||
/// Match <see cref="ExtraRule.Token"/> against the a regex.
|
||||
/// </summary>
|
||||
Regex = 2
|
||||
Regex = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Match <see cref="ExtraRule.Token"/> against the directory name of the file.
|
||||
/// </summary>
|
||||
DirectoryName = 3,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user