Add support for featured apps

This commit is contained in:
Maniack Crudelis
2019-02-01 15:11:12 +01:00
parent 1c2ebe65f7
commit d1035b6117
2 changed files with 33 additions and 1 deletions

View File

@ -145,6 +145,7 @@ for app, info in apps_list.items():
app_state = info["state"]
app_level = info.get("level")
app_maintained = info.get("maintained", True)
app_featured = info.get("featured", False)
forge_site = app_url.split('/')[2]
owner = app_url.split('/')[3]
@ -167,6 +168,7 @@ for app, info in apps_list.items():
previous_url = already_built_file.get(app, {}).get("git", {}).get("url")
previous_level = already_built_file.get(app, {}).get("level")
previous_maintained = already_built_file.get(app, {}).get("maintained")
previous_featured = already_built_file.get(app, {}).get("featured")
if forge_type == "github" and app_rev == "HEAD":
@ -210,6 +212,9 @@ for app, info in apps_list.items():
if previous_maintained != app_maintained:
result_dict[app]["maintained"] = app_maintained
print("... but maintained status changed, updating it from '%s' to '%s'" % (previous_maintained, app_maintained))
if previous_featured != app_featured:
result_dict[app]["featured"] = app_featured
print("... but featured status changed, updating it from '%s' to '%s'" % (previous_featured, app_featured))
print "update translations but don't download anything"
result_dict[app]['manifest'] = include_translations_in_manifest(app, result_dict[app]['manifest'])
@ -318,7 +323,8 @@ for app, info in apps_list.items():
'manifest': include_translations_in_manifest(manifest['id'], manifest),
'state': info['state'],
'level': info.get('level', '?'),
'maintained': app_maintained
'maintained': app_maintained,
'featured': app_featured
}
except KeyError as e:
print("-> Error: invalid app info or manifest, %s" % e)