Files
romm/backend/utils
Georges-Antoine Assi 03636ec156 fix(player): boot the base game, not a patch or translation (#5538)
* fix(player): boot the base game, not a patch or translation

Files in a game's translations/ or hacks/ folder were mixed in with the
base game: a .ups or .bps there counted as a bootable translation, a
tagged variant sorting first became the default, and "All discs" zipped
every file so EmulatorJS booted a translation's playlist.

Patch files are now recognised by extension wherever they sit, the
default and the selector's order favour the top-level (base) files, and
"All discs" requests only the base set through file_ids. The content
endpoint generates its playlist when the served files carry none, rather
than when the rom has one anywhere.

Fixes #5462

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(player): apply code-review fixes

Share the m3u check through has_playlist, memoise the boot file ids, and
correct the playerDisc comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(player): simplify the base-set helpers

One allDiscFiles helper backs offersAllDiscs, defaultDisc and bootFileIds,
and isPatchFile alone owns the patch rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(player): keep variants and media out of playlists; classify patches on the backend

The backend's disc rule now leaves out patches, media and cheats, and a
playlist covers only the base game's discs, so whole-rom downloads, the
native shell and the streaming disc swap stop listing translations, hacks
or a selected manual. A selection with no disc gets no generated .m3u.

The scanner files any patch format as a patch, and the file schema does
the same for rows scanned before, so the frontend trusts the category.
The heartbeat now carries the supported patch extensions, which replaces
the frontend copy, and one fileExtension helper replaces three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:56:17 -05:00
..
2026-07-06 22:17:56 -04:00