mirror of https://github.com/Jackett/Jackett
Cardigann: add support for default categories
This commit is contained in:
parent
ecec3d2006
commit
5b07e6424a
|
@ -31,6 +31,8 @@ namespace Jackett.Common.Indexers
|
|||
protected WebClientStringResult landingResult;
|
||||
protected IHtmlDocument landingResultDocument;
|
||||
|
||||
protected List<string> DefaultCategories = new List<string>();
|
||||
|
||||
new ConfigurationData configData
|
||||
{
|
||||
get { return (ConfigurationData)base.configData; }
|
||||
|
@ -172,6 +174,8 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
}
|
||||
AddCategoryMapping(Categorymapping.id, TorznabCat, Categorymapping.desc);
|
||||
if (Categorymapping.Default)
|
||||
DefaultCategories.Add(Categorymapping.id);
|
||||
}
|
||||
}
|
||||
LoadValuesFromJson(null);
|
||||
|
@ -1082,6 +1086,11 @@ namespace Jackett.Common.Indexers
|
|||
variables[".Query.Episode"] = query.GetEpisodeSearchString();
|
||||
|
||||
var mappedCategories = MapTorznabCapsToTrackers(query);
|
||||
if (mappedCategories.Count == 0)
|
||||
{
|
||||
mappedCategories = this.DefaultCategories;
|
||||
}
|
||||
|
||||
variables[".Categories"] = mappedCategories;
|
||||
|
||||
var KeywordTokens = new List<string>();
|
||||
|
|
|
@ -90,6 +90,7 @@ namespace Jackett.Common.Models
|
|||
public string id { get; set; }
|
||||
public string cat { get; set; }
|
||||
public string desc { get; set; }
|
||||
public bool Default { get; set; }
|
||||
}
|
||||
|
||||
public class capabilitiesBlock
|
||||
|
|
Loading…
Reference in New Issue