From 0e2d349f312611db6a78d86db2e837f2fa24e596 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 21 May 2026 08:27:07 +0800 Subject: [PATCH] auto-sync: 2026-05-21 08:27:07 --- src/api/project_routes.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/project_routes.py b/src/api/project_routes.py index 37e517b..6c73cff 100644 --- a/src/api/project_routes.py +++ b/src/api/project_routes.py @@ -31,9 +31,13 @@ async def list_projects(): if db_path.exists(): try: conn = sqlite3.connect(str(db_path), timeout=5) - count = conn.execute("SELECT COUNT(*) FROM tasks").fetchone()[0] + total = conn.execute("SELECT COUNT(*) FROM tasks WHERE status != 'cancelled'").fetchone()[0] + active = conn.execute("SELECT COUNT(*) FROM tasks WHERE status NOT IN ('cancelled','done') AND COALESCE(archived,0)=0").fetchone()[0] + archived = total - active conn.close() - info['task_count'] = count + info['task_count'] = active + info['task_count_total'] = total + info['task_count_archived'] = archived except Exception: pass # 虚拟项目 _general:如果 blackboard.db 存在则插入