* Files re-indexed strictly after `since` (ms since epoch), newest first. * * `total` is the real count; `paths` is capped at `limit`. Used by the * viewer's live channel to name what a sync just picked up. A file the same * sync DELETED cannot appear here — it has no row left — which is
(since: number, limit: number)
| 4330 | * empty list as "nothing happened". |
| 4331 | */ |
| 4332 | getFilesIndexedSince(since: number, limit: number): { paths: string[]; total: number } { |
| 4333 | const count = this.db |
| 4334 | .prepare('SELECT COUNT(*) AS n FROM files WHERE indexed_at > ?') |
| 4335 | .get(since) as { n: number } | undefined; |
| 4336 | const rows = this.db |
| 4337 | .prepare('SELECT path FROM files WHERE indexed_at > ? ORDER BY indexed_at DESC, path LIMIT ?') |
| 4338 | .all(since, Math.max(0, limit)) as Array<{ path: string }>; |
| 4339 | return { paths: rows.map((r) => r.path), total: count?.n ?? rows.length }; |
| 4340 | } |
| 4341 | |
| 4342 | /** |
| 4343 | * Get files that need re-indexing (hash changed) |
no test coverage detected