* 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)
| 4441 | * empty list as "nothing happened". |
| 4442 | */ |
| 4443 | getFilesIndexedSince(since: number, limit: number): { paths: string[]; total: number } { |
| 4444 | const count = this.db |
| 4445 | .prepare('SELECT COUNT(*) AS n FROM files WHERE indexed_at > ?') |
| 4446 | .get(since) as { n: number } | undefined; |
| 4447 | const rows = this.db |
| 4448 | .prepare('SELECT path FROM files WHERE indexed_at > ? ORDER BY indexed_at DESC, path LIMIT ?') |
| 4449 | .all(since, Math.max(0, limit)) as Array<{ path: string }>; |
| 4450 | return { paths: rows.map((r) => r.path), total: count?.n ?? rows.length }; |
| 4451 | } |
| 4452 | |
| 4453 | /** |
| 4454 | * Get files that need re-indexing (hash changed) |
no test coverage detected