mirror of https://github.com/Jackett/Jackett
torznab movie-search: normalize imdbid
This commit is contained in:
parent
6a3cb442e3
commit
19a3078203
|
@ -98,11 +98,13 @@ namespace Jackett.Controllers
|
||||||
return GetErrorXML(201, "Incorrect parameter: please specify either imdbid or q");
|
return GetErrorXML(201, "Incorrect parameter: please specify either imdbid or q");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ParseUtil.GetImdbID(torznabQuery.ImdbID) == null)
|
var imdbid = ParseUtil.GetImdbID(torznabQuery.ImdbID);
|
||||||
|
if (imdbid == null)
|
||||||
{
|
{
|
||||||
logger.Warn(string.Format("A movie-search request from {0} was made with an invalid imdbid.", Request.GetOwinContext().Request.RemoteIpAddress));
|
logger.Warn(string.Format("A movie-search request from {0} was made with an invalid imdbid.", Request.GetOwinContext().Request.RemoteIpAddress));
|
||||||
return GetErrorXML(201, "Incorrect parameter: invalid imdbid format");
|
return GetErrorXML(201, "Incorrect parameter: invalid imdbid format");
|
||||||
}
|
}
|
||||||
|
torznabQuery.ImdbID = "tt" + ((int)imdbid).ToString("D7");
|
||||||
|
|
||||||
if (!indexer.TorznabCaps.SupportsImdbSearch)
|
if (!indexer.TorznabCaps.SupportsImdbSearch)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace Jackett.Utils
|
||||||
if (!match.Success)
|
if (!match.Success)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return CoerceInt(match.Groups[1].Value);
|
return int.Parse(match.Groups[1].Value, NumberStyles.Any, CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue