diff options
| author | bugfixin <steve@bugfix.in> | 2019-04-18 21:47:19 +0000 |
|---|---|---|
| committer | bugfixin <steve@bugfix.in> | 2019-04-19 17:53:51 +0000 |
| commit | 0794a3edf48eb232030560c4a03587cd77f38b65 (patch) | |
| tree | f65d12384e545c65ab27a4c9976a856e300c85bb /Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs | |
| parent | 7bea62adbfc7350c01a222cb92c86c13c0b43412 (diff) | |
Adjust detection of 'sample' in filenames to use regex boundaries
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..c9d4e4342 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; |
