AI创作批量生成任务 V3 修复AI创作客户端排序

This commit is contained in:
2026-07-15 13:23:02 +08:00
parent 0ffb35e2df
commit 7d9c50a74d
+1 -1
View File
@@ -347,7 +347,7 @@ async def list_tasks(
# 同一个 API 同时服务管理后台和客户端: # 同一个 API 同时服务管理后台和客户端:
# - 管理员保持数据库倒序,最新记录在列表上方; # - 管理员保持数据库倒序,最新记录在列表上方;
# - 普通用户先查询最新一页,再仅反转当前页,聊天消息从旧到新排列。 # - 普通用户先查询最新一页,再仅反转当前页,聊天消息从旧到新排列。
items_for_output = items if is_admin else list(reversed(items)) items_for_output = items if is_admin else sorted(items, key=lambda x: x.created_at if x.created_at is not None else x.id,reverse=False)
out_items = await build_task_out_list( out_items = await build_task_out_list(
db, db,
items_for_output, items_for_output,