TorrentDay: Add IMDB search (#466)

TorrentDay: Add IMDB search
This commit is contained in:
flightlevel 2016-08-24 23:02:25 +10:00 committed by GitHub
parent 2a7a950d63
commit 3e9165ce4a
2 changed files with 12 additions and 3 deletions

View File

@ -100,7 +100,8 @@ namespace Jackett.Controllers
ApiKey = request.passkey,
Categories = MOVIE_CATS,
SearchTerm = request.search,
ImdbID = request.imdbid
ImdbID = request.imdbid,
QueryType = "TorrentPotato"
};
IEnumerable<ReleaseInfo> releases = new List<ReleaseInfo>();

View File

@ -54,6 +54,7 @@ namespace Jackett.Indexers
AddCategoryMapping(25, TorznabCatType.MoviesSD);
AddCategoryMapping(11, TorznabCatType.MoviesHD);
AddCategoryMapping(5, TorznabCatType.MoviesHD);
AddCategoryMapping(48, TorznabCatType.Movies);
AddCategoryMapping(3, TorznabCatType.MoviesSD);
AddCategoryMapping(21, TorznabCatType.MoviesSD);
AddCategoryMapping(22, TorznabCatType.MoviesForeign);
@ -154,8 +155,15 @@ namespace Jackett.Indexers
var queryUrl = SearchUrl;
var queryCollection = new NameValueCollection();
if (!string.IsNullOrWhiteSpace(searchString))
queryCollection.Add("search", searchString);
if (query.QueryType == "TorrentPotato" && !string.IsNullOrWhiteSpace(query.ImdbID) && query.ImdbID.ToLower().StartsWith("tt"))
{
queryCollection.Add("search", query.ImdbID);
}
else
{
if (!string.IsNullOrWhiteSpace(searchString))
queryCollection.Add("search", searchString);
}
foreach (var cat in MapTorznabCapsToTrackers(query))
queryCollection.Add("c" + cat, "1");