mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 01:58:41 +01:00
Quality pass over the jukebox feature: extract helpers the diff had duplicated, collapse copy-pasted template blocks, and remove wasted work on paths that run per render or per keystroke. Reuse: - share shuffled() from utils instead of two Fisher-Yates copies - add v2/utils/errorMessage.ts and v2/utils/jukebox.ts so the mode list has one owner instead of three hand-maintained copies - game_cover_url reuses MusicTrackSchema.cover_url_for Simplification: - launch tiles and the session-mode ternary become data-driven - drop unused order options from the music service and the unreachable romId fallback in deleteSoundtrack - extract buildPlayerPayload() from its two call sites Efficiency: - count music tracks over a single-column projection - group tracks with push instead of rebuilding each bucket array - precompute track rows so the list stops rescanning per render - page the catalog and the panel's two fetches in parallel - update a favorite in place rather than rebuilding three arrays - debounce the search URL write alongside the fetch Also adds freeRadio tests and fixes a vue-tsc error on route.query.game. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>