add setting to auto clear unassigned tabs after duration

This commit is contained in:
Fabian Freund
2026-01-14 06:02:12 +01:00
parent 53df72d906
commit aa2123d636
10 changed files with 139 additions and 4 deletions
@@ -387,4 +387,15 @@ class TabDao extends DatabaseAccessor<TabDatabase> with $TabDaoMixin {
);
}
}
Future<List<String>> getUnassignedTabsOlderThan(DateTime threshold) {
final query = selectOnly(db.tab)
..addColumns([db.tab.id])
..where(
db.tab.containerId.isNull() &
db.tab.timestamp.isSmallerThanValue(threshold),
);
return query.map((row) => row.read(db.tab.id)!).get();
}
}