UI: fix category order

This commit is contained in:
kaso17
2017-12-05 15:40:13 +01:00
parent 3ba8dda800
commit f7fb87f62b
2 changed files with 5 additions and 11 deletions

View File

@@ -38,7 +38,11 @@ namespace Jackett.Models.DTO
alternativesitelinks = indexer.AlternativeSiteLinks;
caps = indexer.TorznabCaps.Categories.Select(c => new Capability
caps = indexer.TorznabCaps.Categories
.GroupBy(p => p.ID)
.Select(g => g.First())
.OrderBy(c => c.ID < 100000 ? "z" + c.ID.ToString() : c.Name)
.Select(c => new Capability
{
ID = c.ID.ToString(),
Name = c.Name

View File

@@ -96,16 +96,6 @@ namespace Jackett.Models
return supportsCategory;
}
public JArray CapsToJson()
{
var jArray = new JArray();
foreach (var cat in Categories.GroupBy(p => p.ID).Select(g => g.First()).OrderBy(c => c.ID < 100000 ? "z" + c.ID.ToString() : c.Name))
{
jArray.Add(cat.ToJson());
}
return jArray;
}
public string ToXml()
{
var xdoc = new XDocument(