mirror of https://github.com/Jackett/Jackett
Use params IMDBID, TVDBID, TVMAZEID and TMDBID with json response (#15015)
This commit is contained in:
parent
4b00491152
commit
8e771dc62a
|
@ -9,6 +9,10 @@ namespace Jackett.Common.Models.DTO
|
|||
public string Query { get; set; }
|
||||
public int[] Category { get; set; }
|
||||
public string[] Tracker { get; set; }
|
||||
public string ImdbId { get; set; }
|
||||
public int TvdbId { get; set; }
|
||||
public int TmdbId { get; set; }
|
||||
public int TvMazeId { get; set; }
|
||||
|
||||
public static TorznabQuery ToTorznabQuery(ApiSearch request)
|
||||
{
|
||||
|
@ -50,6 +54,10 @@ namespace Jackett.Common.Models.DTO
|
|||
|
||||
stringQuery.SearchTerm = queryStr;
|
||||
stringQuery.Categories = request.Category ?? Array.Empty<int>();
|
||||
stringQuery.TmdbID = request.TmdbId;
|
||||
stringQuery.TvdbID = request.TvdbId;
|
||||
stringQuery.ImdbID = request.ImdbId;
|
||||
stringQuery.TvmazeID = request.TvMazeId;
|
||||
|
||||
// try to build an IMDB Query (tt plus 6 to 8 digits)
|
||||
if (stringQuery.SanitizedSearchTerm.StartsWith("tt") && stringQuery.SanitizedSearchTerm.Length <= 10)
|
||||
|
@ -67,6 +75,9 @@ namespace Jackett.Common.Models.DTO
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return stringQuery;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -212,6 +212,26 @@ namespace Jackett.Server.Controllers
|
|||
{
|
||||
request.Query = t.Value.ToString();
|
||||
}
|
||||
|
||||
if (t.Key == "imdbid")
|
||||
{
|
||||
request.ImdbId = t.Value.ToString();
|
||||
}
|
||||
|
||||
if (t.Key == "tmdbid")
|
||||
{
|
||||
request.TmdbId = Int32.Parse(t.Value.ToString());
|
||||
}
|
||||
|
||||
if (t.Key == "tvdbid")
|
||||
{
|
||||
request.TvdbId = Int32.Parse(t.Value.ToString());
|
||||
}
|
||||
|
||||
if (t.Key == "tvmazeid")
|
||||
{
|
||||
request.TvMazeId = Int32.Parse(t.Value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
var manualResult = new ManualSearchResult();
|
||||
|
|
Loading…
Reference in New Issue