mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Use params IMDBID, TVDBID, TVMAZEID and TMDBID with json response (#15015)
This commit is contained in:
@@ -9,6 +9,10 @@ namespace Jackett.Common.Models.DTO
|
|||||||
public string Query { get; set; }
|
public string Query { get; set; }
|
||||||
public int[] Category { get; set; }
|
public int[] Category { get; set; }
|
||||||
public string[] Tracker { 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)
|
public static TorznabQuery ToTorznabQuery(ApiSearch request)
|
||||||
{
|
{
|
||||||
@@ -50,6 +54,10 @@ namespace Jackett.Common.Models.DTO
|
|||||||
|
|
||||||
stringQuery.SearchTerm = queryStr;
|
stringQuery.SearchTerm = queryStr;
|
||||||
stringQuery.Categories = request.Category ?? Array.Empty<int>();
|
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)
|
// try to build an IMDB Query (tt plus 6 to 8 digits)
|
||||||
if (stringQuery.SanitizedSearchTerm.StartsWith("tt") && stringQuery.SanitizedSearchTerm.Length <= 10)
|
if (stringQuery.SanitizedSearchTerm.StartsWith("tt") && stringQuery.SanitizedSearchTerm.Length <= 10)
|
||||||
@@ -67,6 +75,9 @@ namespace Jackett.Common.Models.DTO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return stringQuery;
|
return stringQuery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -212,6 +212,26 @@ namespace Jackett.Server.Controllers
|
|||||||
{
|
{
|
||||||
request.Query = t.Value.ToString();
|
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();
|
var manualResult = new ManualSearchResult();
|
||||||
|
Reference in New Issue
Block a user