torznab movie-search: normalize imdbid

This commit is contained in:
kaso17 2017-01-23 16:16:13 +01:00
parent 6a3cb442e3
commit 19a3078203
2 changed files with 4 additions and 2 deletions

View File

@ -98,11 +98,13 @@ namespace Jackett.Controllers
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));
return GetErrorXML(201, "Incorrect parameter: invalid imdbid format");
}
torznabQuery.ImdbID = "tt" + ((int)imdbid).ToString("D7");
if (!indexer.TorznabCaps.SupportsImdbSearch)
{

View File

@ -80,7 +80,7 @@ namespace Jackett.Utils
if (!match.Success)
return null;
return CoerceInt(match.Groups[1].Value);
return int.Parse(match.Groups[1].Value, NumberStyles.Any, CultureInfo.InvariantCulture);
}
}
}