Stop a folder wipe from restoring the pre-wipe library catalog.
The in-memory catalog could outlive the write, so delete-all came back as thousands of empty tiles and a stale badge. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-2
@@ -6,9 +6,9 @@ Nuxt 3 app, Nitro `node-server`, Vue 3. Production image is `node:22.23.4-alpine
|
||||
|
||||
`server/utils/library.ts` stores one catalog per owner under `users/<owner>/`. The owner key is a hash of the session identity, or a single private-instance id when password auth is on. Catalog writes are serialized per owner and written to a temp file, then renamed.
|
||||
|
||||
`deleteStill`, `deleteStillFamily`, and `wipeFolderContents` update the catalog even if `rmSync` fails. After those writes, `pruneMissingStillMasters` drops any remaining still whose master file is gone. `publicLibrary` and `publicLibraryPage` run that prune before they return rows or folder counts.
|
||||
`deleteStill`, `deleteStillFamily`, and `wipeFolderContents` update the catalog even if `rmSync` fails. A folder wipe removes every still, clip, and track for that folder, checks the folder is empty, and drops that owner's in-memory catalog cache. The next read loads the file that was just written. It does not treat an unchanged mtime as proof the cache is current. `pruneMissingStillMasters` only drops stills whose master file is missing. `publicLibrary` and `publicLibraryPage` run that prune before they return rows or folder counts. The wipe route returns that read after the cache drop.
|
||||
|
||||
Studio 2 reads a paged `/api/library` list. After a delete it refetches that list and clears form slots that pointed at the deleted id.
|
||||
Studio 2 reads a paged `/api/library` list. After a delete or wipe it replaces local library state from the server response, refetches that list, and clears the stage still and form slots that pointed at a removed id. A folder `imageCount` of 0 is an empty folder.
|
||||
|
||||
## Auth
|
||||
|
||||
|
||||
Reference in New Issue
Block a user