Files
astra-mobile/src/db/libraryMaintenance.ts
T
2026-07-14 01:14:16 -04:00

11 lines
428 B
TypeScript

import type { LibraryDatabase } from './database';
export const REBUILD_LOCAL_LIBRARY_INDEX_SQL =
"UPDATE tracks SET mtime = -1 WHERE source_type = 'local'";
/** Marks only device-local rows stale so the normal scanner re-extracts them. */
export async function markLocalTracksStaleForRebuild(db: LibraryDatabase): Promise<number> {
const result = await db.run(REBUILD_LOCAL_LIBRARY_INDEX_SQL);
return result.changes;
}