From 19a3078203a836b2e6c66a0195051c2a546a347b Mon Sep 17 00:00:00 2001 From: kaso17 Date: Mon, 23 Jan 2017 16:16:13 +0100 Subject: [PATCH] torznab movie-search: normalize imdbid --- src/Jackett/Controllers/TorznabController.cs | 4 +++- src/Jackett/Utils/ParseUtil.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Jackett/Controllers/TorznabController.cs b/src/Jackett/Controllers/TorznabController.cs index 3c4e9484e..c1c6027fc 100644 --- a/src/Jackett/Controllers/TorznabController.cs +++ b/src/Jackett/Controllers/TorznabController.cs @@ -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) { diff --git a/src/Jackett/Utils/ParseUtil.cs b/src/Jackett/Utils/ParseUtil.cs index ced78ff7e..c53d67912 100644 --- a/src/Jackett/Utils/ParseUtil.cs +++ b/src/Jackett/Utils/ParseUtil.cs @@ -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); } } } \ No newline at end of file