mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-06 09:21:07 +03:00
update:archive_old_apks: handle apps with no CVC
If an app doesn't have a CVC, we can just skip any special archive handling. Also rename weirdly named `res` to `apkList`.
This commit is contained in:
parent
ee162d9e62
commit
ee4ee85cbd
1 changed files with 7 additions and 7 deletions
|
@ -2009,19 +2009,19 @@ def make_categories_txt(repodir, categories):
|
||||||
|
|
||||||
|
|
||||||
def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversions):
|
def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversions):
|
||||||
|
|
||||||
def filter_apk_list_sorted(apk_list):
|
def filter_apk_list_sorted(apk_list):
|
||||||
res = []
|
apkList = []
|
||||||
currentVersionApk = None
|
currentVersionApk = None
|
||||||
for apk in apk_list:
|
for apk in apk_list:
|
||||||
if apk['packageName'] == appid:
|
if apk['packageName'] == appid:
|
||||||
if apk['versionCode'] == common.version_code_string_to_int(app.CurrentVersionCode):
|
if app.CurrentVersionCode is not None:
|
||||||
currentVersionApk = apk
|
if apk['versionCode'] == common.version_code_string_to_int(app.CurrentVersionCode):
|
||||||
continue
|
currentVersionApk = apk
|
||||||
res.append(apk)
|
continue
|
||||||
|
apkList.append(apk)
|
||||||
|
|
||||||
# Sort the apk list by version code. First is highest/newest.
|
# Sort the apk list by version code. First is highest/newest.
|
||||||
sorted_list = sorted(res, key=lambda apk: apk['versionCode'], reverse=True)
|
sorted_list = sorted(apkList, key=lambda apk: apk['versionCode'], reverse=True)
|
||||||
if currentVersionApk:
|
if currentVersionApk:
|
||||||
# Insert apk which corresponds to currentVersion at the front
|
# Insert apk which corresponds to currentVersion at the front
|
||||||
sorted_list.insert(0, currentVersionApk)
|
sorted_list.insert(0, currentVersionApk)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue