Skip to content

feat(jukebox): add sountracks playing center - #4197

Open
wadiebs wants to merge 4 commits into
rommapp:masterfrom
wadiebs:agent/jukebox
Open

feat(jukebox): add sountracks playing center#4197
wadiebs wants to merge 4 commits into
rommapp:masterfrom
wadiebs:agent/jukebox

Conversation

@wadiebs

@wadiebs wadiebs commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

This change introduces a Jukebox for browsing and playing soundtracks across the entire RomM library. The Jukebox is available from the user menu as a beta feature. Its home screen provides curated playlists and several ways to browse the soundtrack library.

Playlists:

  • Free Radio with a randomized, album-balanced session of up to 60 minutes
  • Decade Mix
  • Recently added soundtracks, limited to 25 tracks
  • Favorite soundtracks

Library:

  • Play all
  • Soundtracks by album
  • Soundtracks by platform
  • Soundtracks by artist
  • Soundtracks by genre

Player Changes

  • Reuse the game soundtrack panel across every Jukebox mode
  • Select and start the first track when a playlist loads
  • Keep transport controls visible while scrolling the playlist
  • Add persistent shuffle support to the full and mini players
  • Preserve shuffled order across metadata and favorite-state refreshes
  • Automatically scroll the active shuffled track into view
  • Add track actions for play, favorite, download, and delete
  • Gate favorite actions using the playlist-write permission
  • Show the mini player when returning to the Jukebox home screen
  • Preserve the existing 140px player artwork

Backend Changes

  • Extend music track responses with game genres, creation date, and game cover
  • Add the playlist.edit UI permission derived from playlist-write access
  • Load complete music libraries in paginated chunks of 1,000 tracks

Localization

Jukebox labels and messages were added for every supported locale.

Testing

  • Locale completeness check
  • Locale alphabetical-order check
  • Python syntax validation
  • Git whitespace validation
  • Frontend typecheck and build, dependencies unavailable locally
  • Manual browser verification in both themes and responsive layouts

Screenshots

jukebox v1

Copilot AI lite review requested due to automatic review settings August 14, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new v2 “Jukebox” feature that lets users browse and play soundtrack tracks across the full RomM library, backed by new/extended music APIs and enhancements to the shared soundtrack player (shuffle, favorites, artwork fallbacks).

Changes:

  • Introduces a new v2 Jukebox view (home + multiple browse/playlist modes) and wires it into routing and the user menu.
  • Enhances the shared soundtrack player/panels (persistent shuffle, track actions menu, mini-player behavior, artwork resolution).
  • Extends backend music track responses and permissions, and updates generated frontend API types and locales.

Reviewed changes

Copilot reviewed 30 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/v2/views/Jukebox.vue New v2 Jukebox view implementing playlist/library browsing modes and integrating SoundtrackPanel.
frontend/src/v2/utils/freeRadio.ts Adds Free Radio session builder and duration helpers for randomized, album-balanced playback.
frontend/src/v2/router/routes.ts Registers the v2 route component for the new “music” route.
frontend/src/v2/components/Soundtrack/MiniPlayer.vue Updates mini-player visibility logic for Jukebox + adds shuffle control and artwork fallback.
frontend/src/v2/components/GameDetails/SoundtrackPanel.vue Reworks panel to support both ROM-based and catalog-based track lists, adds actions (favorite/download/delete), shuffle UX, and scrolling.
frontend/src/v2/components/AppShell/UserMenu.vue Adds a beta Jukebox entry under the Tools group in the user menu.
frontend/src/stores/soundtrackPlayer.ts Adds playlist-level shuffle support, playlist restoration behavior, and game artwork resolution helper.
frontend/src/services/api/music.ts Introduces music API client helpers including chunked getAllTracks and favorites endpoints.
frontend/src/plugins/router.ts Adds the /music route and ROUTES constant for Jukebox navigation.
frontend/src/locales/zh_TW/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/zh_CN/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/tr_TR/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/ru_RU/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/ro_RO/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/pt_BR/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/pl_PL/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/ko_KR/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/ja_JP/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/it_IT/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/hu_HU/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/fr_FR/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/es_ES/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/en_US/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/en_GB/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/de_DE/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/cs_CZ/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/locales/bg_BG/common.json Adds common labels/messages for Jukebox and player actions.
frontend/src/generated/models/MusicTrackSchema.ts Updates generated schema to include genres, added_at, and game cover URL.
frontend/src/generated/models/ActionKey.ts Updates generated ActionKey union to include playlist.edit.
backend/handler/database/roms_handler.py Extends music track query with game genres and file creation date, plus metadata join.
backend/endpoints/responses/permission.py Adds playlist.edit action key and maps it from playlist write permission.
backend/endpoints/responses/music.py Extends music response schema with genres, added_at, and game cover URL generation.
Files not reviewed (2)
  • frontend/src/generated/models/ActionKey.ts: Generated file
  • frontend/src/generated/models/MusicTrackSchema.ts: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +133 to +145
if (preserveShuffle && wasShuffled) {
const tracksByKey = new Map(
tracks.map((item) => [item.romId + ":" + item.fileId, item]),
);
const restored = previousOrder.flatMap((item) => {
const next = tracksByKey.get(item.romId + ":" + item.fileId);
if (!next) return [];
tracksByKey.delete(item.romId + ":" + item.fileId);
return [next];
});
playlist.value = [...restored, ...tracksByKey.values()];
return;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved the review note : Shuffle state can become misleading

Comment on lines +14 to +23
export function buildFreeRadioSession(
tracks: MusicTrackSchema[],
random: () => number = Math.random,
): MusicTrackSchema[] {
const eligibleTracks = tracks.filter(
(track) =>
typeof track.duration_seconds === "number" &&
Number.isFinite(track.duration_seconds) &&
track.duration_seconds > 0,
);
@wadiebs

wadiebs commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Copilot comment addressed

@gantoine
gantoine self-requested a review August 16, 2026 18:11
@gantoine gantoine added the on-hold Pending further research or blocked by another issue label Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-hold Pending further research or blocked by another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants