Support category hierarchies
Now that we have more specific categories for apps in fdroiddata, we also have a lot more categories. While it becomes easier to find relevant apps within categories, it now becomes harder to find the right category.
Therefore, I am suggesting to introduce parent/child relationships for categories, so we can present them in hierarchies for hopefully easier visual parsing:
Multimedia
┠ Offline players
┠ Online players
┠ Downloaders
┠ Podcast
┠ Radio
In order to represent this in a backwards-compatible fashion in our data structured, I propose a new optional parent field for categories:
Multimedia:
name: Multimedia
Offline Music & Video Player:
name: Offline players
parent: Multimedia
Online Music & Video Player:
name: Online players
parent: Multimedia
This would translate to the index-v2 as follows"
"categories": {
"Multimedia": {
"name": {
"en-US": "Multimedia",
}
},
"Offline Music & Video Player": {
"name": {
"en-US": "Offline players",
},
"parent": "Multimedia"
},
"Online Music & Video Player": {
"name": {
"en-US": "Online players",
},
"parent": "Multimedia"
}
}
Our code here would make to be sure that the value of parent refers to another category with exactly that ID. If such a category isn't defined, an error should be thrown.