浏览代码

Fix usage of RegexOptions.Compiled

cvium 3 年之前
父节点
当前提交
9e665ff520
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Emby.Naming/Video/ExtraResolver.cs

+ 2 - 2
Emby.Naming/Video/ExtraResolver.cs

@@ -60,9 +60,9 @@ namespace Emby.Naming.Video
                 {
                     var filename = Path.GetFileName(path);
 
-                    var regex = new Regex(rule.Token, RegexOptions.IgnoreCase | RegexOptions.Compiled);
+                    var isMatch = Regex.IsMatch(filename, rule.Token, RegexOptions.IgnoreCase | RegexOptions.Compiled);
 
-                    if (regex.IsMatch(filename))
+                    if (isMatch)
                     {
                         result.ExtraType = rule.ExtraType;
                         result.Rule = rule;