webapp: drop rig:playlist pipeline, source track count from mpc stats

The four overlays that read /data/playlist.js (loading, goodbye,
music-box, music/nc) only ever consumed `tracks.length` for cosmetic
"LIBRARY :: N TRACKS" / "indexed N tracks" flavor text — all live
playback signal flows through bridges/mpd-state.py over OBS WS. The
142 KB JSON, ffprobe walk, and ETag-cached route were all producing
one integer that MPD itself already knows.

RigData::playlistCount() now shells `mpc stats` and parses "Songs: N",
returning 0 on any failure (treated by callers as empty library).
Removes RigPlaylistCommand, DataController::playlist(), the
/data/playlist.js route, the per-overlay <script src> + window.__PLAYLIST
shims, and the stale storage/data/playlist.json artifact.

AudioController still consumes config('rig.music_dirs') for the HTTP
audio stream — that's orthogonal and stays.
This commit is contained in:
Jakub Zych
2026-05-22 21:04:24 +02:00
parent dd3493921b
commit fd1c78b333
12 changed files with 39 additions and 213 deletions

View File

@@ -30,9 +30,8 @@ Route::prefix('music-box')->controller(MusicBoxController::class)->group(functio
Route::get('nc', 'nc');
});
Route::get('/data/playlist.js', [DataController::class, 'playlist']);
Route::get('/cover.jpg', [DataController::class, 'coverImage']);
Route::get('/track', [AudioController::class, 'stream']);
Route::get('/cover.jpg', [DataController::class, 'coverImage']);
Route::get('/track', [AudioController::class, 'stream']);
Route::post('/cmd/{type}', [MusicCommandController::class, 'send'])
->whereIn('type', ['skip', 'prev', 'pause', 'resume']);