diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-03-30 15:35:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-30 15:35:56 +0200 |
| commit | b49d50e6346901e695a328e778b4cf3cc7114700 (patch) | |
| tree | 9151124ce2a4b15ab84b80aba01d951b2d948ff9 /Emby.Server.Implementations/Library/PathExtensions.cs | |
| parent | a890a8509228f6a357a6986549afc492da74b146 (diff) | |
| parent | 1669cb661858676e40f0e7f89205e4e93111da85 (diff) | |
Merge pull request #5467 from Ullmie02/nfo-fixes
Diffstat (limited to 'Emby.Server.Implementations/Library/PathExtensions.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/PathExtensions.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.cs index 57d0c26b9..6eaecff0f 100644 --- a/Emby.Server.Implementations/Library/PathExtensions.cs +++ b/Emby.Server.Implementations/Library/PathExtensions.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Text.RegularExpressions; +using MediaBrowser.Common.Providers; namespace Emby.Server.Implementations.Library { @@ -43,8 +44,8 @@ namespace Emby.Server.Implementations.Library // for imdbid we also accept pattern matching if (string.Equals(attribute, "imdbid", StringComparison.OrdinalIgnoreCase)) { - var m = Regex.Match(str, "tt([0-9]{7,8})", RegexOptions.IgnoreCase); - return m.Success ? m.Value : null; + var match = ProviderIdParsers.TryFindImdbId(str, out var imdbId); + return match ? imdbId.ToString() : null; } return null; |
