diff options
| author | David <daullmer@gmail.com> | 2021-03-16 21:11:34 +0100 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2021-03-16 21:45:12 +0100 |
| commit | 14cbd22fbe0a1989f70895edbd0a0f52d850d55e (patch) | |
| tree | 02cdb92d82b8c3bec10c24c14264237f5abcc297 /Emby.Server.Implementations/Library/PathExtensions.cs | |
| parent | 954148eb6de1f276fb584aa70b384babea0e58ce (diff) | |
Use Helper Methods for provider url parsing
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 7dcc925c2..72fe5a854 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.TryParseImdbId(str, out var imdbId); + return match ? imdbId : null; } return null; |
