feat(12-01): implement library CRUD methods and orphan cleanup pipeline
- Add AddLibrary, RenameLibrary, RemoveLibrary, GetRemovalImpact methods - RemoveLibrary follows exact order: phantom populate → delete audio_files → orphan cleanup → commit → FTS5 rebuild → cover art file cleanup → queue compact → events - Add cancelLibraryScan and currentTrackBelongsToLibrary helpers - Add RemovalHooks type and removalHooks field on Library struct - Add LibraryAdded, LibraryRenamed, LibraryRemoved event constants - Regenerate frontend events.ts with new CRUD events - All hand-crafted SQL has SAFETY comments per project convention - Dual artist_credit FK check (recordings + release_groups) for orphan cleanup
This commit is contained in:
@@ -42,6 +42,11 @@ export const Events = {
|
||||
// Scan queue events
|
||||
LibraryScanQueued: "LibraryScanQueued",
|
||||
LibraryScanQueueDrained: "LibraryScanQueueDrained",
|
||||
|
||||
// Library CRUD events
|
||||
LibraryAdded: "LibraryAdded",
|
||||
LibraryRenamed: "LibraryRenamed",
|
||||
LibraryRemoved: "LibraryRemoved",
|
||||
} as const;
|
||||
|
||||
export type EventName = (typeof Events)[keyof typeof Events];
|
||||
|
||||
Reference in New Issue
Block a user