diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-07-06 23:08:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-06 23:08:52 +0200 |
| commit | 82f041d050f998d20818efff063b6000dfcbf5d2 (patch) | |
| tree | 3be5cf1a79180c57a5381e26f60d61088a27b49e /Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs | |
| parent | 4f17ed961e2756e0c65b1bb0246e7f62a5f44a8a (diff) | |
| parent | ba551b48e1e1c80192e10b1bb340d974c6b6dee2 (diff) | |
Merge branch 'master' into release-10.3.z
Diffstat (limited to 'Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index c644d13ea..a70077163 100644 --- a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Resolvers; @@ -148,15 +149,9 @@ namespace Emby.Server.Implementations.Library } // Ignore samples - var sampleFilename = " " + filename.Replace(".", " ", StringComparison.OrdinalIgnoreCase) - .Replace("-", " ", StringComparison.OrdinalIgnoreCase) - .Replace("_", " ", StringComparison.OrdinalIgnoreCase) - .Replace("!", " ", StringComparison.OrdinalIgnoreCase); + Match m = Regex.Match(filename,@"\bsample\b",RegexOptions.IgnoreCase); - if (sampleFilename.IndexOf(" sample ", StringComparison.OrdinalIgnoreCase) != -1) - { - return true; - } + return m.Success; } return false; |
