auto-sync: 2026-05-21 23:45:20
This commit is contained in:
@@ -32,7 +32,7 @@ async def list_projects():
|
||||
try:
|
||||
conn = sqlite3.connect(str(db_path), timeout=5)
|
||||
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]
|
||||
active = conn.execute("SELECT COUNT(*) FROM tasks WHERE COALESCE(archived,0)=0").fetchone()[0]
|
||||
archived = total - active
|
||||
conn.close()
|
||||
info['task_count'] = active
|
||||
@@ -46,7 +46,7 @@ async def list_projects():
|
||||
try:
|
||||
conn = sqlite3.connect(str(general_db), timeout=5)
|
||||
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]
|
||||
active = conn.execute("SELECT COUNT(*) FROM tasks WHERE COALESCE(archived,0)=0").fetchone()[0]
|
||||
conn.close()
|
||||
projects["_general"] = {
|
||||
"id": "_general", "name": "一般任务", "description": "无项目归属的通用任务",
|
||||
@@ -61,7 +61,7 @@ async def list_projects():
|
||||
try:
|
||||
conn = sqlite3.connect(str(general_db_check), timeout=5)
|
||||
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]
|
||||
active = conn.execute("SELECT COUNT(*) FROM tasks WHERE COALESCE(archived,0)=0").fetchone()[0]
|
||||
conn.close()
|
||||
projects["_general"]["task_count"] = active
|
||||
projects["_general"]["task_count_total"] = total
|
||||
|
||||
Reference in New Issue
Block a user