From 1c9213e7f1baa645602efbf41633231c80d19947 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Mon, 16 Jan 2017 17:23:51 +0100 Subject: [PATCH] PassThePopcorn: enable IMDB search --- src/Jackett/Indexers/PassThePopcorn.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Jackett/Indexers/PassThePopcorn.cs b/src/Jackett/Indexers/PassThePopcorn.cs index c49c71781..1bf3ae481 100644 --- a/src/Jackett/Indexers/PassThePopcorn.cs +++ b/src/Jackett/Indexers/PassThePopcorn.cs @@ -45,6 +45,8 @@ namespace Jackett.Indexers Encoding = Encoding.UTF8; Language = "en-us"; + TorznabCaps.SupportsImdbSearch = true; + AddCategoryMapping(1, TorznabCatType.Movies); AddCategoryMapping(1, TorznabCatType.MoviesForeign); AddCategoryMapping(1, TorznabCatType.MoviesOther); @@ -95,18 +97,17 @@ namespace Jackett.Indexers bool configCheckedOnly = configData.FilterString.Value.ToLowerInvariant().Contains("checked"); string movieListSearchUrl; - if (string.IsNullOrEmpty(query.GetQueryString())) - movieListSearchUrl = string.Format("{0}?json=noredirect", SearchUrl); - else + if (!string.IsNullOrEmpty(query.ImdbID)) { - if (!string.IsNullOrEmpty(query.ImdbID)) - { - movieListSearchUrl = string.Format("{0}?json=noredirect&searchstr={1}", SearchUrl, HttpUtility.UrlEncode(query.ImdbID)); - } - else - { - movieListSearchUrl = string.Format("{0}?json=noredirect&searchstr={1}", SearchUrl, HttpUtility.UrlEncode(query.GetQueryString())); - } + movieListSearchUrl = string.Format("{0}?json=noredirect&searchstr={1}", SearchUrl, HttpUtility.UrlEncode(query.ImdbID)); + } + else if(!string.IsNullOrEmpty(query.GetQueryString())) + { + movieListSearchUrl = string.Format("{0}?json=noredirect&searchstr={1}", SearchUrl, HttpUtility.UrlEncode(query.GetQueryString())); + } + else + { + movieListSearchUrl = string.Format("{0}?json=noredirect", SearchUrl); } var results = await RequestStringWithCookiesAndRetry(movieListSearchUrl);