mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
normalize Build TYPE_LIST data based on .txt
In the future, we should have better internal datatypes for this stuff, i.e. instead of gradle: ['yes'] for True, actually use a boolean. For now, make the YAML and JSON metadata produce the same internal data as .txt.
This commit is contained in:
parent
f7ae398aae
commit
c178cfb843
4 changed files with 175 additions and 177 deletions
|
|
@ -818,6 +818,15 @@ def post_metadata_parse(app):
|
|||
for build in app['builds']:
|
||||
if not isinstance(build, Build):
|
||||
build = Build(build)
|
||||
for k, v in build.items():
|
||||
if flagtype(k) == TYPE_LIST:
|
||||
if isinstance(v, str):
|
||||
build[k] = [v]
|
||||
elif isinstance(v, bool):
|
||||
if v:
|
||||
build[k] = ['yes']
|
||||
else:
|
||||
build[k] = []
|
||||
builds.append(build)
|
||||
|
||||
if not app.get('Description'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue