diff --git a/qmd.ts b/qmd.ts index 3f3ce74..26896f0 100755 --- a/qmd.ts +++ b/qmd.ts @@ -533,11 +533,7 @@ async function updateCollections(): Promise { const col = collections[i]; console.log(`${c.cyan}[${i + 1}/${collections.length}]${c.reset} ${c.bold}${col.pwd}${c.reset}`); console.log(`${c.dim} Pattern: ${col.glob_pattern}${c.reset}`); - // Temporarily set PWD for indexing - const originalPwd = process.env.PWD; - process.env.PWD = col.pwd; - await indexFiles(col.glob_pattern); - process.env.PWD = originalPwd; + await indexFiles(col.pwd, col.glob_pattern); console.log(""); } diff --git a/store.ts b/store.ts index c175a48..cdd3869 100644 --- a/store.ts +++ b/store.ts @@ -1119,18 +1119,6 @@ export function getActiveDocumentPaths(db: Database, collectionId: number): stri return rows.map(r => r.path); } -/** - * Clean up orphaned content hashes (content not referenced by any active document). - * Returns the number of orphaned hashes deleted. - */ -export function cleanupOrphanedContent(db: Database): number { - const result = db.prepare(` - DELETE FROM content - WHERE hash NOT IN (SELECT DISTINCT hash FROM documents WHERE active = 1) - `).run(); - return result.changes; -} - // Re-export from llm.ts for backwards compatibility export { formatQueryForEmbedding, formatDocForEmbedding };