Commit Graph

199 Commits

Author SHA1 Message Date
Georges-Antoine Assi
fc46c3eb1c Merge branch 'master' into feat/demozoo-pouet-phase0
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>
2026-08-30 21:32:11 -04:00
Georges-Antoine Assi
c0d01c58ee fix(metadata): harden the scene metadata handlers
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>
2026-08-30 20:49:14 -04:00
Georges-Antoine Assi
414dea2b49 Merge remote-tracking branch 'origin/master' into agent/jukebox
# Conflicts:
#	frontend/src/stores/soundtrackPlayer.ts
#	frontend/src/v2/components/GameDetails/MediaTab.vue
#	frontend/src/v2/components/GameDetails/SoundtrackPanel.vue
2026-08-30 15:16:45 -04:00
Georges-Antoine Assi
974b2a4be7 refactor(music): simplify jukebox and share duplicated helpers
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>
2026-08-30 07:20:51 -04:00
Georges-Antoine Assi
0708216236 refactor(jsdos): trim comments and inline a single-use constant
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>
2026-08-29 11:44:18 -04:00
Georges-Antoine Assi
74be063522 fix(jsdos): only offer the player for .jsdos bundles
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>
2026-08-29 11:34:47 -04:00
Georges-Antoine Assi
4142fbc018 refactor: dedupe js-dos emulation checks and player plumbing
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>
2026-08-29 10:20:47 -04:00
Georges-Antoine Assi
c38282f989 test: cover the useCanPlay file gate
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>
2026-08-29 09:59:27 -04:00
Georges-Antoine Assi
eed9549a2a Merge branch 'master' into 3143-jsdos-backend
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>
2026-08-29 09:33:18 -04:00
Matt Van Horn
86d8aea09c fix: Preserve nested arcade ROM filenames
Fixes #1893
2026-08-22 21:16:35 -07:00
Axel Quack
a3f7484c0c feat(ui): surface Demozoo, Pouët, and CSDb in Setup, Scan, and Edit ROM
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.
2026-08-17 08:59:54 +01:00
Bruno Henriques
154340d332 feat: playable Win3.x and Win9.x using js-dos 2026-08-16 18:49:49 +01:00
Sam Dornan
7b8158de66 fix(frontend): swap the inverted Asia and Australia region emoji
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>
2026-08-15 19:01:10 -05:00
Georges-Antoine Assi
edd36d83f4 test: expect URL-encoded path segment for selected file
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>
2026-07-19 22:21:16 -04:00
Georges-Antoine Assi
05857c0148 cleanup 2026-07-19 22:12:18 -04:00
Georges-Antoine Assi
2ac81fa841 Apply suggestion from @greptile-apps[bot]
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-19 22:07:27 -04:00
Georges-Antoine Assi
1ec40fdb29 fix: load selected file with correct extension for multi-file roms
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>
2026-07-19 21:55:59 -04:00
Georges-Antoine Assi
de63580fcf trunk fmt everything 2026-07-19 20:35:51 -04:00
suriel123
e1a9c0b7aa fix: stop mapping public domain to Poland 2026-07-05 00:35:35 +08:00
Roberto Romero
abdc446ff2 Fix typo in core mapping from 'zsx' to 'zxs'
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.
2026-07-02 10:18:27 +00:00
zurdi
bf801cb314 feat(permissions): narrow user role to admin/user and adapt v1
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>
2026-06-25 22:42:51 +00:00
Georges-Antoine Assi
e471efb987 feat(v2): morph gallery cover into the player on Play
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>
2026-06-22 12:46:31 -04:00
zurdi
84a4c80ba6 feat: enhance game actions and menu interactions
- 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.
2026-06-16 17:20:47 +02:00
zurdi
9f6138d010 Merge branch 'master' into chore/frontend-v2
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>
2026-06-16 01:19:55 +02:00
Georges-Antoine Assi
cd101758fd cleanup for simplicity 2026-06-08 11:13:15 -04:00
Georges-Antoine Assi
3ca45fafc1 [ROMM-3457] Add tgcd and supergrafx to emulatorjs platform list 2026-05-31 09:23:53 -04:00
Georges-Antoine Assi
9e5f49a6fc update jsdoc 2026-05-30 21:53:44 -04:00
Georges-Antoine Assi
96ac7ac5e8 only add new cores in nightly 2026-05-30 20:53:52 -04:00
Georges-Antoine Assi
be15ab4513 feat(player): add genesis_plus_gx_wide, bsnes, freeintv, azahar EJS cores
- 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>
2026-05-30 04:30:47 -04:00
zurdi
4409570d2a feat: enhance smart collection and metadata dialogs with improved filtering and context handling
- 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.
2026-05-26 11:01:29 +00:00
Georges-Antoine Assi
fb13f54f48 cleanup 2026-05-24 17:43:01 -04:00
Claude
5adffeca71 perf(roms): skip rom_files load on gallery list endpoint
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.
2026-05-24 15:02:02 +00:00
Georges-Antoine Assi
22e273f0f5 add sync to task type item 2026-03-16 08:54:40 -04:00
Georges-Antoine Assi
4bfd050a57 Merge branch 'master' into api-form-fields 2026-03-06 17:12:18 -05:00
Georges-Antoine Assi
b2cfb953b8 add desmune to core selection for 3ds 2026-02-28 23:30:45 -05:00
Georges-Antoine Assi
f4d9961460 really go all out with typing stuff 2026-02-18 17:41:50 -05:00
Georges-Antoine Assi
dc685911f0 fix trunk check 2026-02-07 22:07:15 -05:00
Georges-Antoine Assi
a29cb75767 fix mapped value 2026-02-07 21:38:31 -05:00
Georges-Antoine Assi
2d678ef19f [ROMM-2976] Fix no games displayed for status filter 2026-02-07 21:27:24 -05:00
Georges-Antoine Assi
5c15fe2137 [HOTFIX] Only add ? to qs on download path 2026-01-16 17:22:00 -05:00
zurdi
cbe368e388 Add formatRelativeDate utility and update components to use it for improved date display 2025-12-17 12:45:56 +00:00
zurdi
d0101a4220 Refactor save and state selection logic; improve empty cover image aspect ratio handling 2025-12-17 10:41:12 +00:00
Georges-Antoine Assi
ba4ed763a8 run fmt 2025-12-01 20:19:59 -05:00
Tanguy Mazé
040dc9fa56 refactor(i18n): add getBrowserCompatibleLocale utility and fix missing locale in notes
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:20:44 +01:00
Tanguy Mazé
12b34bfada feat(i18n): fix French translations and add locale-aware date formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:58:58 +01:00
Georges-Antoine Assi
2f5df3cd24 changes from bot review 2025-10-25 19:34:00 -04:00
Georges-Antoine Assi
66d985fa02 changes from bot review 2025-10-25 12:22:50 -04:00
Georges-Antoine Assi
2dc4cacd98 animate on play btn 2025-10-25 11:41:35 -04:00
Georges-Antoine Assi
90e579e2ce Spin disks on hover 2025-10-25 10:03:34 -04:00
Georges-Antoine Assi
f919951a22 self code cleanup 2025-10-23 10:36:08 -04:00