修复:移除常驻通知底部模板按钮;提前完成只留带备注记录、隐藏无备注源任务行(v0.8)

This commit is contained in:
XIGE
2026-11-29 09:25:24 +08:00
parent 2448ca0be5
commit bcddbe9879
5 changed files with 28 additions and 25 deletions

View File

@@ -308,6 +308,24 @@ object Store {
)
}
/**
* 已被"提前完成"关闭的源任务 id 集合。
*
* 提前完成 = 源任务标记已完成 + 一条带备注的独立完成记录(origin_id 指回源任务),
* 列表里只应显示带备注的记录那条;完成记录的特征是 repeat_type = 0
* (重复任务实例虽然也有 origin_id,但 repeat_type > 0,不会误伤)。
*/
fun completedSourceIds(): Set<Long> {
val ids = HashSet<Long>()
db.rawQuery(
"SELECT DISTINCT origin_id FROM tasks WHERE done = 1 AND origin_id > 0 AND repeat_type = 0",
null,
).use { c ->
while (c.moveToNext()) ids.add(c.getLong(0))
}
return ids
}
/**
* 一次专注结束 = 一条独立的完成任务记录。
*