Renumber the two migrations onto master's head: 0108/0109 collided with
0108_roms_primary_region and 0109_rom_files_category_index, leaving the
chain with two heads. They are now 0114 and 0115 behind 0113.
Both rebuild the roms_facets sync triggers from a hardcoded column list,
so add the publishers and developers columns 0112 introduced. Without
them the rebuilt triggers would have silently stopped mirroring the two.
Adopt master's provider taxonomy. METADATA_PROVIDER_GROUPS now carries
demozoo, pouet, and csdb as catalogs, which replaces the branch's own
GENERAL_PROVIDER_KEYS set and feeds the setup wizard, the scan dialog,
and Settings from one registry. CSDb reaches the scan explainer for the
first time; it was already selectable there.
Regenerate the frontend types: DetailedRomSchema was missing the three
metadata blobs the backend has always declared on RomSchema, and the
blobs are now typed rather than Record<string, unknown>.
Correct the setup strings that still called the three sources enabled by
default, and sort the locale keys.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Security review follow-ups on the Demozoo, Pouet, and CSDb handlers.
Default the three sources to off, matching every other provider. They
were the only ones defaulting to on, so an upgrade began contacting
demozoo.org, pouet.net, and csdb.dk on the next scan with no operator
opt-in, reachable through the unauthenticated metadata heartbeat.
Guard the bare id conversion in scene_id_or_none. str.isdigit() accepts
superscripts and other digits int() rejects, so a pasted "²" raised out
of the Edit ROM endpoint as a 500.
Filter the remote demozoo_url through http_url(). It was the only one of
the three URL fields taking a string from the API rather than building
one from a hardcoded template and an integer id.
Match a YouTube id against an explicit ASCII class. isalnum() is
Unicode-aware, so it accepted ids the embed URL never can.
Stream the CSDb response against a byte budget. The cap ran after the
whole body was already buffered, so it bounded the parse but not memory.
Catch defusedxml's refusals. EntitiesForbidden derives from ValueError
and ParseError from SyntaxError, so the existing handler caught neither
and an entity-declaring document raised out of production_from_xml.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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>
Review-polish pass: cut the js-dos docstrings and the CDN-base comment back to
the non-obvious fact, drop JSDOS_BUNDLE_EXTENSION now that it has one call site
whose meaning is plain, and remove a redundant Partial<SimpleRom> cast from the
new fixture helper.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
js-dos boots exactly one format. Its `url` option runs the file through
emulators.bundleConfig(), which requires an archive carrying
`.jsdos/dosbox.conf`; handed an ordinary scanned game it panics with
"Broken bundle, .jsdos/dosbox.conf not found" and the player never starts.
Gate canPlayJsDos on the file extension so Play is offered only for files the
player can actually boot, instead of routing a win3x/win9x ROM to a dead
screen. The platform-level check is unchanged: usePlatformPlayable knows only
a slug, and a win3x platform is still playable in browser given a bundle.
Booting unbundled games would mean supplying `dosboxConf` and `initFs`
ourselves, which needs entrypoint detection and, for Win9x, a system image.
That is a feature in its own right, not a fix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
usePlatformPlayable is the platform-level twin of useCanPlay, but only the
latter learned about js-dos, so win3x/win9x games offered Play while their
platform tile showed no playable badge and sorted into the unplayable bucket.
Teach resolveEmulator about js-dos and derive `playable`/`isPlayable` from it
instead of hand-maintained OR chains.
Collapse the duplication the new backend introduced: a shared
resolvePlatformSlug in utils, a supportedBy factory for useCanPlay's three
identical computeds, one COOP/COEP nginx pattern per map, and a single
hard-navigation branch in useGameActions that reuses the canPlay useCanPlay
already returns.
In JsDos.vue, share the teardown tail between leavePlayer and onBeforeUnmount,
collapse four derivations of the route rom id into one, start the js-dos
runtime alongside the rom request rather than behind it, and hold the rom in a
shallowRef since the view only reads scalars off it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
useCanPlay had no tests of its own, and useGameActions mocks it wholesale,
so nothing exercised the has_file_on_disk gate that keeps a physical or
missing-file game from offering a Play action. Add the missing suite,
including a case per engine so the js-dos route cannot regain the gate.
Also apply trunk fmt to a js-dos case in utils/index.test.ts.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Resolve conflicts in useCanPlay and its useGameActions tests, where master
added the has_file_on_disk gate to the play checks while this branch added
the js-dos route. Keep both: js-dos also boots from the ROM file, so it gets
the same gate as EmulatorJS and Ruffle.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add the three sources to Classic and v2 settings, Scan, and Edit ROM.
Edit ROM accepts a production URL or a bare id. Metadata tab extra
links render only http(s) hrefs.
regionToEmoji mapped the bare code "as" to the Australian flag and "a" to
the Asia globe, the reverse of the REGIONS table (A=Australia, AS=Asia).
Harmless while every stored region is a full name, but reachable now that
region codes resolve more loosely.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The greptile suggestion added encodeURIComponent to the selected file
name in getDownloadPath, but the test still expected a literal space.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Multi-file roms (e.g. multi-disk Amiga games) failed to launch in the
EmulatorJS player with "Unsupported file format: ''", while single-file
roms on the same platform worked.
EmulatorJS derives the on-disk filename it writes to the emulator FS from
the last path segment of the game URL, and the core determines the disk
format from that filename's extension. getDownloadPath used the ROM-level
fs_name for that segment. For multi-file roms the rom is a folder, so
fs_name has no extension, and the core received an extension-less file.
When a single file is selected, use that file's real name (extension
included) as the content path segment instead of fs_name. The backend
already serves the correct file for a single file_ids value and only uses
the path segment for zip/m3u naming, so multi-file and no-selection cases
are unchanged.
Fixes#3746
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The EJS core mapping in frontend/src/utils/index.ts keyed the ZX
Spectrum entry as zsx instead of the canonical platform slug zxs (as defined by UniversalPlatformSlug.ZXS in backend/handler/metadata/base_handler.py).
Renaming the key to zxs restores in-browser play for ZX Spectrum.
Collapse the Role enum from viewer/editor/admin to two kinds (admin/user);
non-admin access now comes entirely from permission groups + overrides.
Backend:
- Role -> StrEnum {USER, ADMIN}, VARCHAR-backed (native_enum=False); Role.coerce
maps legacy/unknown strings (incl. in-flight invites) to USER.
- Resolver: group-less users fall back to the default group (dropped the
role-based legacy fallback); kiosk caps all non-admins to read-only.
- OIDC editor/viewer claims both map to USER (env var names unchanged).
- Migration 0092 converts the native enum to VARCHAR and normalizes
ADMIN->admin, VIEWER/EDITOR->user.
- Updated endpoints, conftest fixtures, role/oidc/parity/db-handler tests, tools.
Frontend:
- v2 + v1 user management now use admin/user (dropdowns, defaults, getRoleIcon).
- Regenerated types (Role = 'user' | 'admin'); added role-user i18n to all locales.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Clicking Play at the center of a gallery cover now runs the shared-element
view transition into the /ejs (EmulatorJS) or /ruffle hero, matching the
card → details morph.
- useGameActions gains an optional `coverEl` resolver; `play()` wraps the
navigation in `morphTransition` (cover → player hero, same `rom-cover-<id>`
tag the player paints statically) and awaits the push so the snapshot is
taken after the player renders. GameCard supplies its GameCover box.
- The player heroes only seeded `rom` from `currentRom` (set via GameDetails),
so a direct gallery→play left `rom` null and the `v-if`-gated hero never
rendered — nothing to morph into. Seed a lightweight `heroSeed` SimpleRom
from the gallery store (new `galleryRoms.getRomById`) so the cover paints
its morph tag immediately; `rom` fills in on mount. Play is disabled until
the full payload loads.
- Enable hover-motion on both player heroes so the cover spin / hover video
work there too.
- Arcade systems (arcade / neogeoaes / neogeomvs) skip the cartridge slot-in
animation (new `isArcadeSystem`).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Updated `useGameActions` to improve navigation handling during game play.
- Modified `RMenu` to allow modifier-clicks on links to open in new tabs without closing the menu.
- Added new stories and tests for `RMenuItem` to ensure correct behavior for new-tab gestures.
- Introduced `colorCoverArt` for procedural cover-art generation, ensuring consistent styling across missing and unmatched cover images.
- Implemented SVG generation for cover art in `covers.ts`, providing unique visuals for identified and unidentified ROMs.
- Enhanced `EmulatorJS` and `Ruffle` views to support dynamic cover art based on selected styles, improving user experience during gameplay.
- Refactored cover image handling to support animations and maintain aspect ratios.
Adopt master's ROM schema design (sibling_roms + files, batched
get_files_for_roms / get_siblings_for_roms) while preserving the v2-branch
features master lacks: per-user is_main_sibling on siblings and audio_meta
on rom files.
Conflict resolution:
- responses/rom.py: keep master's sibling_roms/files fields; re-graft
is_main_sibling via SiblingRomSchema.from_rom(rom, is_main_sibling=...);
restore the eager-relationship fallback in
SimpleRomSchema.from_orm_with_request (None sentinel) so the v2
/{id}/simple endpoint still returns siblings/files.
- roms_handler.py: get_siblings_for_roms now left-joins RomUser and returns
(Rom, is_main_sibling) tuples; keep both branch and master file helpers.
- drop the redundant branch-only sibling_ids field and
get_sibling_data_for_roms.
- generated types resolved to match (sibling_roms + files; RomFileSchema
keeps audio_meta and gains archive_members).
- update v2 components and the RelatedGameCard mock to read sibling_roms.
- fix stale exclude={"siblings"} -> "sibling_roms" in scan emit payloads.
- re-chain the audio_meta migration as 0083 (after master's 0082) to keep a
single Alembic head.
- package.json: union of branch tooling + master dependency bumps; lock
regenerated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- genesis_plus_gx_wide added alongside genesis_plus_gx for all Sega
MD/MS/GG/CD platforms
- bsnes added alongside snes9x for SNES platforms
- freeintv added for Intellivision
- azahar added for Nintendo 3DS (3ds, new-nintendo-3ds) and marked as
requiring threads
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Updated CreateSmartCollectionDialog to include current collection and virtual collection IDs for better context.
- Enhanced RefreshMetadataDialog with new hash matcher options and improved UI for metadata sources selection.
- Improved SearchCoverDialog to conditionally display provider covers based on selected cover type.
- Added collection and virtual collection lookups in CollectionSettingsDrawer for better filter summaries.
- Updated MatchRom components to handle cases where matches may not have covers, improving user feedback.
- Enhanced smart collection criteria handling in utils to support additional context and summary lookups.
The gallery list endpoint was eager-loading every rom_file row for each
paginated ROM via selectinload, then re-joining each row back to its
parent rom for the is_top_level computation. For platforms with extracted
multi-file ROMs (Xbox 360 ~1394 files/ROM, Switch ~199 files/ROM), this
made /api/roms time out at 120s even with a rom_id index.
Cards never displayed individual files — only the has_simple_single_file
/ has_nested_single_file / has_multiple_files booleans that derive from
the file list. Denormalize the underlying state onto roms as multi_file
(folder-based vs single-file) and top_level_file_count, recompute the
booleans from those columns, drop the selectinload from filter_roms, and
move the files field from SimpleRomSchema to DetailedRomSchema so the
gallery payload no longer ships file rows.
Also drop the redundant joinedload(RomFile.rom) and switch the relation
to lazy="select" so subsequent file.rom accesses resolve from the
session identity map instead of re-JOINing the parent rom per file row.
ShowQRCode.vue's folder-based DS/3DS fallback now fetches the detailed
rom on demand, since SimpleRom no longer carries files.