Fix imdbid regex

This commit is contained in:
randrey 2020-04-18 17:26:22 -07:00
parent e333e6765a
commit d7a71cee3c
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Library
// for imdbid we also accept pattern matching // for imdbid we also accept pattern matching
if (string.Equals(attrib, "imdbid", StringComparison.OrdinalIgnoreCase)) if (string.Equals(attrib, "imdbid", StringComparison.OrdinalIgnoreCase))
{ {
var m = Regex.Match(str, "tt\\d{7}", RegexOptions.IgnoreCase); var m = Regex.Match(str, "tt\\d{7,}", RegexOptions.IgnoreCase);
return m.Success ? m.Value : null; return m.Success ? m.Value : null;
} }

View File

@ -208,8 +208,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
protected void ParseProviderLinks(T item, string xml) protected void ParseProviderLinks(T item, string xml)
{ {
// Look for a match for the Regex pattern "tt" followed by 7 digits // Look for a match for the Regex pattern "tt" followed by 7 or more digits
var m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase); var m = Regex.Match(xml, @"tt(\d{7,})", RegexOptions.IgnoreCase);
if (m.Success) if (m.Success)
{ {
item.SetProviderId(MetadataProviders.Imdb, m.Value); item.SetProviderId(MetadataProviders.Imdb, m.Value);