mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
ImdbTVSearchSupport added for c# based indexers (#5791)
This commit is contained in:
@@ -293,7 +293,9 @@ namespace Jackett.Common.Indexers
|
|||||||
if (query.HasSpecifiedCategories)
|
if (query.HasSpecifiedCategories)
|
||||||
if (!caps.SupportsCategories(query.Categories))
|
if (!caps.SupportsCategories(query.Categories))
|
||||||
return false;
|
return false;
|
||||||
if (caps.SupportsImdbMovieSearch && query.IsImdbQuery)
|
if (caps.SupportsImdbTVSearch && query.IsImdbQuery && query.IsTVSearch)
|
||||||
|
return true;
|
||||||
|
if (caps.SupportsImdbMovieSearch && query.IsImdbQuery && query.IsMovieSearch)
|
||||||
return true;
|
return true;
|
||||||
else if (!caps.SupportsImdbMovieSearch && query.IsImdbQuery && query.QueryType != "TorrentPotato") // potato query should always contain imdb+search term
|
else if (!caps.SupportsImdbMovieSearch && query.IsImdbQuery && query.QueryType != "TorrentPotato") // potato query should always contain imdb+search term
|
||||||
return false;
|
return false;
|
||||||
|
@@ -48,6 +48,7 @@ namespace Jackett.Common.Indexers
|
|||||||
Language = "hu-hu";
|
Language = "hu-hu";
|
||||||
Type = "private";
|
Type = "private";
|
||||||
|
|
||||||
|
TorznabCaps.SupportsImdbTVSearch = true;
|
||||||
AddCategoryMapping(1, TorznabCatType.TV);
|
AddCategoryMapping(1, TorznabCatType.TV);
|
||||||
AddCategoryMapping(2, TorznabCatType.TVHD);
|
AddCategoryMapping(2, TorznabCatType.TVHD);
|
||||||
AddCategoryMapping(3, TorznabCatType.TVSD);
|
AddCategoryMapping(3, TorznabCatType.TVSD);
|
||||||
@@ -270,7 +271,19 @@ namespace Jackett.Common.Indexers
|
|||||||
limit = 100;
|
limit = 100;
|
||||||
if (query.IsImdbQuery)
|
if (query.IsImdbQuery)
|
||||||
{
|
{
|
||||||
/* Currently this is not supported for series */
|
seriesinfo = series.Find(x => x.imdbid.Equals(query.ImdbIDShort));
|
||||||
|
if (seriesinfo != null && !query.ImdbIDShort.Equals(""))
|
||||||
|
{
|
||||||
|
String querrySeason = "";
|
||||||
|
if (query.Season != 0)
|
||||||
|
querrySeason = query.Season.ToString();
|
||||||
|
exactSearchURL = SearchUrl + "?s=" + querrySeason + "&e=" + query.Episode + "&g=" + seriesinfo.id + "&now=" + unixTimestamp.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// IMDB_ID was not founded in site database.
|
||||||
|
return releases;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!query.IsImdbQuery || noimdbmatch)
|
if (!query.IsImdbQuery || noimdbmatch)
|
||||||
|
@@ -20,6 +20,8 @@ namespace Jackett.Common.Models
|
|||||||
|
|
||||||
public bool SupportsImdbMovieSearch { get; set; }
|
public bool SupportsImdbMovieSearch { get; set; }
|
||||||
|
|
||||||
|
public bool SupportsImdbTVSearch { get; set; }
|
||||||
|
|
||||||
public bool MusicSearchAvailable
|
public bool MusicSearchAvailable
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -40,6 +42,7 @@ namespace Jackett.Common.Models
|
|||||||
MovieSearchAvailable = false;
|
MovieSearchAvailable = false;
|
||||||
SupportsTVRageSearch = false;
|
SupportsTVRageSearch = false;
|
||||||
SupportsImdbMovieSearch = false;
|
SupportsImdbMovieSearch = false;
|
||||||
|
SupportsImdbTVSearch = false;
|
||||||
SupportedMusicSearchParamsList = new List<string>();
|
SupportedMusicSearchParamsList = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +52,7 @@ namespace Jackett.Common.Models
|
|||||||
TVSearchAvailable = true;
|
TVSearchAvailable = true;
|
||||||
SupportsTVRageSearch = false;
|
SupportsTVRageSearch = false;
|
||||||
SupportsImdbMovieSearch = false;
|
SupportsImdbMovieSearch = false;
|
||||||
|
SupportsImdbTVSearch = false;
|
||||||
SupportedMusicSearchParamsList = new List<string>();
|
SupportedMusicSearchParamsList = new List<string>();
|
||||||
Categories = new List<TorznabCategory>();
|
Categories = new List<TorznabCategory>();
|
||||||
Categories.AddRange(cats);
|
Categories.AddRange(cats);
|
||||||
@@ -62,6 +66,8 @@ namespace Jackett.Common.Models
|
|||||||
var parameters = new List<string>() { "q", "season", "ep" };
|
var parameters = new List<string>() { "q", "season", "ep" };
|
||||||
if (SupportsTVRageSearch)
|
if (SupportsTVRageSearch)
|
||||||
parameters.Add("rid");
|
parameters.Add("rid");
|
||||||
|
if (SupportsImdbTVSearch)
|
||||||
|
parameters.Add("imdbid");
|
||||||
return string.Join(",", parameters);
|
return string.Join(",", parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,6 +166,7 @@ namespace Jackett.Common.Models
|
|||||||
lhs.MovieSearchAvailable = lhs.MovieSearchAvailable || rhs.MovieSearchAvailable;
|
lhs.MovieSearchAvailable = lhs.MovieSearchAvailable || rhs.MovieSearchAvailable;
|
||||||
lhs.SupportsTVRageSearch = lhs.SupportsTVRageSearch || rhs.SupportsTVRageSearch;
|
lhs.SupportsTVRageSearch = lhs.SupportsTVRageSearch || rhs.SupportsTVRageSearch;
|
||||||
lhs.SupportsImdbMovieSearch = lhs.SupportsImdbMovieSearch || rhs.SupportsImdbMovieSearch;
|
lhs.SupportsImdbMovieSearch = lhs.SupportsImdbMovieSearch || rhs.SupportsImdbMovieSearch;
|
||||||
|
lhs.SupportsImdbTVSearch = lhs.SupportsImdbTVSearch || rhs.SupportsImdbTVSearch;
|
||||||
lhs.Categories.AddRange(rhs.Categories.Where(x => x.ID < 100000).Except(lhs.Categories)); // exclude indexer specific categories (>= 100000)
|
lhs.Categories.AddRange(rhs.Categories.Where(x => x.ID < 100000).Except(lhs.Categories)); // exclude indexer specific categories (>= 100000)
|
||||||
|
|
||||||
return lhs;
|
return lhs;
|
||||||
|
@@ -355,10 +355,16 @@ namespace Jackett.Server.Controllers
|
|||||||
return GetErrorXML(201, "Incorrect parameter: invalid imdbid format");
|
return GetErrorXML(201, "Incorrect parameter: invalid imdbid format");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CurrentIndexer.TorznabCaps.SupportsImdbMovieSearch)
|
if (CurrentQuery.IsMovieSearch && !CurrentIndexer.TorznabCaps.SupportsImdbMovieSearch)
|
||||||
{
|
{
|
||||||
logger.Warn($"A search request with imdbid from {Request.HttpContext.Connection.RemoteIpAddress} was made but the indexer {CurrentIndexer.DisplayName} doesn't support it.");
|
logger.Warn($"A search request with imdbid from {Request.HttpContext.Connection.RemoteIpAddress} was made but the indexer {CurrentIndexer.DisplayName} doesn't support it.");
|
||||||
return GetErrorXML(203, "Function Not Available: imdbid is not supported by this indexer");
|
return GetErrorXML(203, "Function Not Available: imdbid is not supported for movie search by this indexer");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CurrentQuery.IsTVSearch && !CurrentIndexer.TorznabCaps.SupportsImdbTVSearch)
|
||||||
|
{
|
||||||
|
logger.Warn($"A search request with imdbid from {Request.HttpContext.Connection.RemoteIpAddress} was made but the indexer {CurrentIndexer.DisplayName} doesn't support it.");
|
||||||
|
return GetErrorXML(203, "Function Not Available: imdbid is not supported for TV search by this indexer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user