aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
diff options
context:
space:
mode:
authorbugfixin <steve@bugfix.in>2019-04-18 21:47:19 +0000
committerbugfixin <steve@bugfix.in>2019-04-19 17:53:51 +0000
commit0794a3edf48eb232030560c4a03587cd77f38b65 (patch)
treef65d12384e545c65ab27a4c9976a856e300c85bb /Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
parent7bea62adbfc7350c01a222cb92c86c13c0b43412 (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.cs11
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;