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:
@@ -93,6 +93,10 @@ type Library struct {
|
||||
scanQueue []scanQueueEntry
|
||||
currentScanLibraryID int64
|
||||
currentScanLibraryName string
|
||||
|
||||
// removalHooks holds callbacks for cross-cutting concerns during
|
||||
// library removal (e.g. stopping playback, compacting queue).
|
||||
removalHooks RemovalHooks
|
||||
}
|
||||
|
||||
// SetRescanHooks provides optional hooks for cross-cutting
|
||||
|
||||
Reference in New Issue
Block a user