mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Feature/improved aggregate results (#1432)
* Line endings... * Add fallback query for meta indexers In cases where multiple indexers are configured under one metaindexer if any of them supports IMDB search the meta will support IMDB search as well. However the actual query will then only be performed by those supporting IMDB search, because others refuse it (see CanHandleQuery implementation). - This adds support of a fallback mechanism for other indexers - Adds first implementation of result improvement (necessary for fallback queries as they might produce irrelevant results) - Some minor fixes encountered while debugging/coding Known issue: - Configuring nCore and IsoHunt together will render results from nCore unusuable. Don't know why.
This commit is contained in:
@@ -111,6 +111,48 @@ namespace Jackett.Models
|
||||
IsTest = false;
|
||||
}
|
||||
|
||||
public TorznabQuery CreateFallback(string search) {
|
||||
var ret = Clone();
|
||||
if (Categories == null || Categories.Length == 0) {
|
||||
ret.Categories = new int[]{ TorznabCatType.Movies.ID,
|
||||
TorznabCatType.MoviesForeign.ID,
|
||||
TorznabCatType.MoviesOther.ID,
|
||||
TorznabCatType.MoviesSD.ID,
|
||||
TorznabCatType.MoviesHD.ID,
|
||||
TorznabCatType.Movies3D.ID,
|
||||
TorznabCatType.MoviesBluRay.ID,
|
||||
TorznabCatType.MoviesDVD.ID,
|
||||
TorznabCatType.MoviesWEBDL.ID,
|
||||
};
|
||||
}
|
||||
ret.SearchTerm = search;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public TorznabQuery Clone() {
|
||||
var ret = new TorznabQuery();
|
||||
ret.QueryType = QueryType;
|
||||
if (Categories != null && Categories.Length > 0) {
|
||||
ret.Categories = new int [Categories.Length];
|
||||
Array.Copy (Categories, ret.Categories, Categories.Length);
|
||||
}
|
||||
ret.Extended = Extended;
|
||||
ret.ApiKey = ApiKey;
|
||||
ret.Limit = Limit;
|
||||
ret.Offset = Offset;
|
||||
ret.Season = Season;
|
||||
ret.Episode = Episode;
|
||||
ret.SearchTerm = SearchTerm;
|
||||
ret.IsTest = IsTest;
|
||||
if (QueryStringParts != null && QueryStringParts.Length > 0) {
|
||||
ret.QueryStringParts = new string [QueryStringParts.Length];
|
||||
Array.Copy (QueryStringParts, ret.QueryStringParts, QueryStringParts.Length);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string GetQueryString()
|
||||
{
|
||||
return (SanitizedSearchTerm + " " + GetEpisodeSearchString()).Trim();
|
||||
|
Reference in New Issue
Block a user