diff options
| author | cvium <clausvium@gmail.com> | 2021-03-10 19:29:52 +0100 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-03-10 19:29:52 +0100 |
| commit | b0af11c34e1c4ac476433944d68a7944598cc5f9 (patch) | |
| tree | 1e1d4c1288d99f5d89b5cc5759e36f80bcc8157e /Emby.Naming/Video | |
| parent | 3824c09e774f35df18f37b56e2fc6101dc2022fe (diff) | |
make the eligibility check more strict wrt. brackets
Diffstat (limited to 'Emby.Naming/Video')
| -rw-r--r-- | Emby.Naming/Video/VideoListResolver.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index 0b44763a2..d71d60954 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -229,15 +229,14 @@ namespace Emby.Naming.Video if (CleanStringParser.TryClean(testFilename, _options.CleanStringRegexes, out var cleanName)) { - testFilename = cleanName.ToString(); + testFilename = cleanName.Trim().ToString(); } - // The CleanStringParser should have removed common keywords etc., so if it starts with -, _ or [ it's eligible. + // The CleanStringParser should have removed common keywords etc. return string.IsNullOrEmpty(testFilename) || testFilename[0] == '-' || testFilename[0] == '_' - || testFilename[0] == '[' - || string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty)); + || Regex.IsMatch(testFilename, @"^\[([^]]*)\]"); } return false; |
