diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2019-07-04 11:38:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-04 11:38:01 -0700 |
| commit | 9e9952d81fbd9105328bc45350ee0f4ad673367a (patch) | |
| tree | f0b624d711574df1a6e22ed434bb0e29f039778f /Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs | |
| parent | 4f2d601f02d56ffe15b0c588c45d699213a8052f (diff) | |
| parent | da842d5a730ea8db2fab8e4c71a501191d54e46c (diff) | |
Merge pull request #1247 from bugfixin/master
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..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; |
