mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-09 02:41:06 +03:00
Back-end support for multiple categories
This commit is contained in:
parent
c84adaafcb
commit
19e999ff0d
1 changed files with 10 additions and 3 deletions
|
@ -212,8 +212,10 @@ def main():
|
||||||
# Generate a list of categories...
|
# Generate a list of categories...
|
||||||
categories = []
|
categories = []
|
||||||
for app in apps:
|
for app in apps:
|
||||||
if app['Category'] not in categories:
|
cats = app['Category'].Split(';')
|
||||||
categories.append(app['Category'])
|
for cat in cats
|
||||||
|
if cat not in categories:
|
||||||
|
categories.append(cat)
|
||||||
|
|
||||||
# Read known apks data (will be updated and written back when we've finished)
|
# Read known apks data (will be updated and written back when we've finished)
|
||||||
knownapks = common.KnownApks()
|
knownapks = common.KnownApks()
|
||||||
|
@ -506,7 +508,12 @@ def main():
|
||||||
common.parse_description(app['Description']), doc, apel)
|
common.parse_description(app['Description']), doc, apel)
|
||||||
addElement('license', app['License'], doc, apel)
|
addElement('license', app['License'], doc, apel)
|
||||||
if 'Category' in app:
|
if 'Category' in app:
|
||||||
addElement('category', app['Category'], doc, apel)
|
# We put the first (primary) category in LAST, which will have
|
||||||
|
# the desired effect of making clients that only understand one
|
||||||
|
# category see that one.
|
||||||
|
cats = app['Category'].split(';').reverse()
|
||||||
|
for cat in cats:
|
||||||
|
addElement('category', cat, doc, apel)
|
||||||
addElement('web', app['Web Site'], doc, apel)
|
addElement('web', app['Web Site'], doc, apel)
|
||||||
addElement('source', app['Source Code'], doc, apel)
|
addElement('source', app['Source Code'], doc, apel)
|
||||||
addElement('tracker', app['Issue Tracker'], doc, apel)
|
addElement('tracker', app['Issue Tracker'], doc, apel)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue