Merge pull request #2915 from randrey/imdbid-length-fix

Fix imdbid regex
pull/2934/head^2
Bond-009 5 years ago committed by GitHub
commit 6f866a7fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

Loading…
Cancel
Save