Imdbid parsing works now from url

pull/2/head
Leonardo Galli 8 years ago
parent a98b69859c
commit 5aaba98c57

@ -29,6 +29,7 @@ namespace NzbDrone.Core.Test.NetImport
var result = Subject.ParseResponse(CreateResponse("http://my.indexer.com/api?q=My+Favourite+Show", xml)); var result = Subject.ParseResponse(CreateResponse("http://my.indexer.com/api?q=My+Favourite+Show", xml));
result.First().Title.Should().Be("Think Like a Man Too"); result.First().Title.Should().Be("Think Like a Man Too");
result.First().ImdbId.Should().Be("tt2239832");
} }
} }
} }

@ -31,7 +31,7 @@ namespace NzbDrone.Core.NetImport.RSSImport
yield return new NetImportDefinition yield return new NetImportDefinition
{ {
Name = GetType().Name, Name = "IMDb Watchlist",
Enabled = config.Validate().IsValid && Enabled, Enabled = config.Validate().IsValid && Enabled,
Implementation = GetType().Name, Implementation = GetType().Name,
Settings = config Settings = config

@ -266,7 +266,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex FileExtensionRegex = new Regex(@"\.[a-z0-9]{2,4}$", private static readonly Regex FileExtensionRegex = new Regex(@"\.[a-z0-9]{2,4}$",
RegexOptions.IgnoreCase | RegexOptions.Compiled); RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex ReportImdbId = new Regex(@"(?<imdbid>tt\d{9})", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex ReportImdbId = new Regex(@"(?<imdbid>tt\d{7})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex SimpleTitleRegex = new Regex(@"(?:480[ip]|576[ip]|720[ip]|1080[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*:|]|848x480|1280x720|1920x1080|(8|10)b(it)?)\s*", private static readonly Regex SimpleTitleRegex = new Regex(@"(?:480[ip]|576[ip]|720[ip]|1080[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*:|]|848x480|1280x720|1920x1080|(8|10)b(it)?)\s*",
RegexOptions.IgnoreCase | RegexOptions.Compiled); RegexOptions.IgnoreCase | RegexOptions.Compiled);
@ -454,7 +454,7 @@ namespace NzbDrone.Core.Parser
{ {
if (match.Groups["imdbid"].Value != null) if (match.Groups["imdbid"].Value != null)
{ {
if (match.Groups["imdbid"].Length == 11) if (match.Groups["imdbid"].Length == 9)
{ {
return match.Groups["imdbid"].Value; return match.Groups["imdbid"].Value;
} }

Loading…
Cancel
Save