From 83093f4c85c00172e7c337746fe4d0b4794d09f6 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 18 Dec 2024 01:15:33 +0800 Subject: [PATCH] Update plugin.py --- web/utils/plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/utils/plugin.py b/web/utils/plugin.py index 306941a12..ad40d47f4 100644 --- a/web/utils/plugin.py +++ b/web/utils/plugin.py @@ -444,6 +444,7 @@ class plugin(object): pInfo = { "id": 10000, + "sort": 10000, "pid": info['pid'], "type": 1000, "name": info['name'], @@ -470,6 +471,9 @@ class plugin(object): if 'icon' in info: pInfo['icon'] = info['icon'] + if 'sort' in info: + pInfo['sort'] = info['sort'] + if checks.find('VERSION') > -1: pInfo['install_checks'] = checks.replace('VERSION', info['versions']) @@ -689,6 +693,8 @@ class plugin(object): for index in range(len(t)): info.append(t[index]) + info = sorted(info, key=lambda f: int(f['sort']), reverse=False) + start = (page - 1) * size end = start + size x = info[start:end]