浏览代码

Fix/6034 get random order of categories in explore and workflow is missing in zh hant (#6043)

crazywoola 10 月之前
父节点
当前提交
3ec80f9dda
共有 3 个文件被更改,包括 226 次插入360 次删除
  1. 0 1
      .vscode/launch.json
  2. 220 358
      api/constants/recommended_apps.json
  3. 6 1
      api/services/recommended_app_service.py

+ 0 - 1
.vscode/launch.json

@@ -13,7 +13,6 @@
             "jinja": true,
             "env": {
                 "FLASK_APP": "app.py",
-                "FLASK_DEBUG": "1",
                 "GEVENT_SUPPORT": "True"
             },
             "args": [

文件差异内容过多而无法显示
+ 220 - 358
api/constants/recommended_apps.json


+ 6 - 1
api/services/recommended_app_service.py

@@ -110,7 +110,12 @@ class RecommendedAppService:
         if response.status_code != 200:
             raise ValueError(f'fetch recommended apps failed, status code: {response.status_code}')
 
-        return response.json()
+        result = response.json()
+
+        if "categories" in result:
+            result["categories"] = sorted(result["categories"])
+        
+        return result
 
     @classmethod
     def _fetch_recommended_apps_from_builtin(cls, language: str) -> dict:

部分文件因为文件数量过多而无法显示