1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

Imdbid parsing works now from url

This commit is contained in:
Leonardo Galli 2017-01-21 20:37:08 +01:00
parent a98b69859c
commit 5aaba98c57
3 changed files with 4 additions and 3 deletions

View File

@ -29,6 +29,7 @@ public void should_handle_relative_url()
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().ImdbId.Should().Be("tt2239832");
}
}
}

View File

@ -31,7 +31,7 @@ public RSSImport(IHttpClient httpClient, IConfigService configService, IParsingS
yield return new NetImportDefinition
{
Name = GetType().Name,
Name = "IMDb Watchlist",
Enabled = config.Validate().IsValid && Enabled,
Implementation = GetType().Name,
Settings = config

View File

@ -266,7 +266,7 @@ public static class Parser
private static readonly Regex FileExtensionRegex = new Regex(@"\.[a-z0-9]{2,4}$",
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*",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
@ -454,7 +454,7 @@ public static string ParseImdbId(string title)
{
if (match.Groups["imdbid"].Value != null)
{
if (match.Groups["imdbid"].Length == 11)
if (match.Groups["imdbid"].Length == 9)
{
return match.Groups["imdbid"].Value;
}