From 933eea149a4b2304125409a07599b04aeeded65d Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Fri, 12 Feb 2021 10:11:50 +0100 Subject: [PATCH] Add needsUpdate and noUpdateCheck to update.json As done in update_wiki. --- fdroidserver/update.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 57e7e4b7..bc31b512 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -142,6 +142,8 @@ def status_update_json(apps, apks): output['disabled'] = [] output['failedBuilds'] = dict() output['noPackages'] = [] + output['needsUpdate'] = [] + output['noUpdateCheck'] = [] for appid in apps: app = apps[appid] @@ -154,8 +156,11 @@ def status_update_json(apps, apks): antiFeatures[af]['apps'].add(appid) apklist = [] + gotcurrentver = False for apk in apks: if apk['packageName'] == appid: + if str(apk['versionCode']) == app.get('CurrentVersionCode'): + gotcurrentver = True apklist.append(apk) validapks = 0 for build in app.get('Builds', []): @@ -175,6 +180,10 @@ def status_update_json(apps, apks): output['noPackages'].append(appid) if app.get('Disabled'): output['disabled'].append(appid) + if not gotcurrentver: + output['needsUpdate'].append(appid) + if app.get('UpdateCheckMode') == 'None' and not app.get('Disabled'): + output['noUpdateCheck'].append(appid) common.write_status_json(output, options.pretty)