diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-10-05 21:47:59 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-10-05 21:47:59 +0200 |
| commit | 67147400bfbecc69d38db5faaea23c9f8d92807b (patch) | |
| tree | 63b37f99b7ce1867c0a86c7832d7647352716c1d /Emby.Naming/Video | |
| parent | d245e45254057c62d058cfad3e56484a77093718 (diff) | |
Fix issue #6123
Diffstat (limited to 'Emby.Naming/Video')
| -rw-r--r-- | Emby.Naming/Video/ExtraResolver.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Emby.Naming/Video/ExtraResolver.cs b/Emby.Naming/Video/ExtraResolver.cs index a32af002c..7bc226614 100644 --- a/Emby.Naming/Video/ExtraResolver.cs +++ b/Emby.Naming/Video/ExtraResolver.cs @@ -11,6 +11,7 @@ namespace Emby.Naming.Video /// </summary> public class ExtraResolver { + private static readonly char[] _digits = new[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; private readonly NamingOptions _options; /// <summary> @@ -62,9 +63,10 @@ namespace Emby.Naming.Video } else if (rule.RuleType == ExtraRuleType.Suffix) { - var filename = Path.GetFileNameWithoutExtension(pathSpan); + // Trim the digits from the end of the filename so we can recognize things like -trailer2 + var filename = Path.GetFileNameWithoutExtension(pathSpan).TrimEnd(_digits); - if (filename.Contains(rule.Token, StringComparison.OrdinalIgnoreCase)) + if (filename.EndsWith(rule.Token, StringComparison.OrdinalIgnoreCase)) { result.ExtraType = rule.ExtraType; result.Rule = rule; |
