fix(13-02): resolve phantom playlist tracks using M3U8 paths after scan

- Add ScanHooks callback struct to library package (follows RemovalHooks pattern)
- Move phantom resolution from library to playlist service via hook
- New ResolvePhantomTracksAfterScan reads M3U8 files and resolves paths
  against current audio_files using multi-root resolution
- Handles pre-existing phantoms (match by M3U8 position) and new ones
  (match by phantom_file_path)
- Delete old resolvePhantomTracks method that required phantom_file_path
- Wire ScanHooks in app.go OnStartup
This commit is contained in:
2026-03-16 12:47:42 -04:00
parent 93262b9ae0
commit 9f595b7ac1
8 changed files with 356 additions and 53 deletions
+6
View File
@@ -171,6 +171,12 @@ func (yj *YellowJacketApp) OnStartup(ctx context.Context) {
PostScan: yj.playlist.RestoreAllPlaylists,
})
// Wire scan hooks so the playlist service can resolve
// phantom tracks after each library scan completes.
yj.library.SetScanHooks(library.ScanHooks{
ResolvePhantoms: yj.playlist.ResolvePhantomTracksAfterScan,
})
// Wire removal hooks so the library can stop playback and
// compact the queue during library removal without depending
// on the player or queue packages directly.