core: rewrite category code from scratch. resolves #8049 (#10031)

* Core: Categories are stored in a real tree
* Sorting: First Torznab categories sorted by Id and then custom cats sorted by Name
* Filtering: Results with child category are not removed when searching by parent category. Details in #8049
* Jacket UI: Add parent category when at least one child category exists
* Torznab (caps): Remove non existent children categories. Remove duplicated categories. Details in #10006
This commit is contained in:
Diego Heras
2020-11-01 12:07:24 +01:00
committed by GitHub
parent 4464d97e2f
commit 7a2e52659a
12 changed files with 360 additions and 153 deletions

View File

@@ -250,7 +250,7 @@ namespace Jackett.Common.Models
new XAttribute("available", MusicSearchAvailable ? "yes" : "no"),
new XAttribute("supportedParams", SupportedMusicSearchParams())
),
// inconsistend but apparently already used by various newznab indexers (see #1896)
// inconsistent but apparently already used by various newznab indexers (see #1896)
new XElement("audio-search",
new XAttribute("available", MusicSearchAvailable ? "yes" : "no"),
new XAttribute("supportedParams", SupportedMusicSearchParams())
@@ -261,7 +261,7 @@ namespace Jackett.Common.Models
)
),
new XElement("categories",
from c in Categories.GetTorznabCategories().OrderBy(x => x.ID < 100000 ? "z" + x.ID.ToString() : x.Name)
from c in Categories.GetTorznabCategoryTree(true)
select new XElement("category",
new XAttribute("id", c.ID),
new XAttribute("name", c.Name),