Commit Graph

10920 Commits

Author SHA1 Message Date
Georges-Antoine Assi
e9539dadeb use allplatforms 2026-07-25 07:39:54 -04:00
SaveEditors
e626c31315 Show empty platforms in platform index 2026-07-25 01:45:47 -04:00
Georges-Antoine Assi
a1272863be Merge pull request #3944 from Spinnich/fix/v2-player-bezel
fix(player): render ScreenScraper bezel in v2 EmulatorJS player
5.1.0-alpha.5
2026-07-24 22:02:19 -04:00
Georges-Antoine Assi
fa64d64973 cleanup 2026-07-24 22:00:22 -04:00
Georges-Antoine Assi
140e2d48ca Merge branch 'master' into fix/v2-player-bezel 2026-07-24 21:40:32 -04:00
Georges-Antoine Assi
1c5d5364fc Merge pull request #3940 from Spinnich/fix/v2-player-stale-disc-id
fix(player): guard v2 EmulatorJS against stale saved disc id
2026-07-24 21:39:29 -04:00
Georges-Antoine Assi
93a128965b Merge pull request #3936 from Spinnich/fix/rom-detail-smart-collections
fix(roms): list the smart collections a ROM belongs to on its detail view
2026-07-24 21:38:13 -04:00
Georges-Antoine Assi
e8aa14e52e cleanup 2026-07-24 20:00:15 -04:00
Spinnich
dd88216973 feat(player): let users hide a game's bezel in the v2 player
A scraped bezel can be misaligned or oversized and obscure the running
game, with no way to turn it off. Add a per-game "Show bezel" switch to
the player's Setup panel, shown only when the game has a bezel. The
choice persists in localStorage (player:<romId>:bezel); bezels stay on
by default and only the hidden state is stored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 22:19:48 +00:00
Spinnich
9a12786fde fix(player): render ScreenScraper bezel in v2 EmulatorJS player
The v2 player never drew a game's bezel overlay. Add it to the v2 shell
(v1 is frozen), building the image URL from the resources base like
covers / box-art so the relative bezel_path resolves to the real PNG
instead of the SPA's HTML fallback.

EmulatorJS fullscreens its own #game container, which the browser
promotes to the top layer, so a sibling overlay vanishes there. Teleport
the bezel into that container while fullscreen so it keeps framing the
game, and keep its z-index below the EmulatorJS controls.

Fixes #3939

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 20:21:41 +00:00
Spinnich
092d901ede fix(player): guard v2 EmulatorJS against stale saved disc id
The v2 player restored the per-game disc choice from localStorage
(player:<romId>:disc) with a bare parseInt and never checked the id still
existed. After a rescan the rom's file ids change, so the player kept
requesting a missing file; the download endpoint 404s and EmulatorJS
surfaces it as a generic "Network Error". Single-file games were hit
hardest since they have no disc picker to recover.

Add a resolveStoredDisc helper that keeps the saved id only when it still
matches a current rom file, otherwise falls back to the first file and
flags the entry as stale so the caller drops it from localStorage. Ports
the v1 guard (d1696cd0) to v2.

Fixes #3938

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 18:40:20 +00:00
Spinnich
c6c80d8239 perf(roms): resolve smart-collection membership in SQL, not Python
The detail response listed a ROM's smart collections by loading every
own/public smart collection and scanning its cached rom_ids list in
Python. rom_ids grows with library size, so this got heavier on large
libraries on every detail load.

Push containment + visibility into the query via the existing cross-DB
json_array_contains_value helper (JSON_CONTAINS on MariaDB/MySQL, @>/?
on Postgres), returning only the matching rows with id/name/is_public.
The schema mapper no longer filters, so smart_for_user becomes the plain
from_smart_collections mapping. Behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 14:57:43 +00:00
Spinnich
a58370b8c0 fix(roms): hydrate smart collections for the detail overview tiles
The overview's Collections row enriches each tile (cover mosaic + rom
count) from the collections store, but the v2 AppLayout only hydrated
regular collections. On direct navigation to a ROM, a smart-collection
tile therefore fell back to a countless, coverless entry ("0 games", no
cover). Fetch smart collections alongside the regular ones so the tiles
resolve their real count and covers.

Fixes #3934

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 14:36:02 +00:00
Spinnich
95d5cbfcdf fix(roms): list smart collections a rom belongs to
The ROM detail response only filled `user_collections` from a rom's
standard collections (the collections_roms join), so smart collections
were silently omitted from the detail overview's Collections row.

Add smart-collection membership to the response: `UserCollectionSchema`
gains an `is_smart` flag and a `smart_for_user` builder that keeps the
smart collections whose cached rom_ids include the rom (respecting own /
public visibility), and `DetailedRomSchema` appends them alongside the
standard ones. The v2 overview renders them with the smart kind badge and
routes them to the smart-collection view.

Fixes #3934

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 14:21:35 +00:00
Georges-Antoine Assi
dcc04aa6ba Merge pull request #3930 from rommapp/fix/idempotent-roms-facets-migrations
fix(backend): make roms_facets/collection migrations idempotent
5.1.0-alpha.4
2026-07-23 21:59:53 -04:00
Georges-Antoine Assi
d95ca18d4a fix(backend): make roms_facets/collection migrations idempotent
MariaDB/MySQL auto-commit each DDL statement, so a failure partway
through 0100/0101/0103 committed the CREATE TABLE / ADD COLUMN but never
advanced alembic_version. Every reboot then re-ran the migration from the
top and died on "Table ... already exists", wedging the boot loop
permanently.

Guard the schema changes so a re-run after a partial failure recovers:
- 0100: CREATE TABLE ... if_not_exists, catalog-check the index, make the
  backfill idempotent with an anti-join, DROP TRIGGER IF EXISTS before
  each CREATE TRIGGER (both MySQL and Postgres paths).
- 0101: same treatment; backfill uses INSERT IGNORE / ON CONFLICT DO
  NOTHING, triggers dropped before recreation, view already drops first.
- 0103: skip add_column for provider ids that are already present.

0102 already used if_not_exists / catalog checks; this brings the rest of
the batch in line. Verified by reproducing the wedged state (version at
0099 with the later tables already present) and confirming upgrade head
now recovers cleanly to 0103, plus the rom_facets and stats test suites.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 21:54:33 -04:00
Georges-Antoine Assi
48d283aa3e Merge pull request #3929 from rommapp/fix/save-origin-device-fk-collation
fix(migrations): pin device FK column collations to match devices.id
5.1.0-alpha.3
2026-07-23 20:29:11 -04:00
Georges-Antoine Assi
288314ff35 fix(migrations): pin device FK column collations to match devices.id
On MariaDB/MySQL a foreign key between VARCHAR columns requires both
sides to share a collation. Migrations 0082 and 0089 added referencing
columns that inherit their table's collation, which can differ from
devices.id on databases whose older tables predate the MariaDB 11.6+
utf8mb4_uca1400_ai_ci default. The FK creation then fails with errno
150 (Foreign key constraint is incorrectly formed).

Look up devices.id's collation from information_schema and create the
referencing column with it, and re-pin the collation when a previous
partial run left the column behind with a mismatched one. No behavior
change on PostgreSQL.

Fixes #3915

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 20:12:53 -04:00
Georges-Antoine Assi
7a859a2777 Merge pull request #3926 from rommapp/dependabot/npm_and_yarn/frontend/linkify-it-5.0.2
build(deps): bump linkify-it from 5.0.1 to 5.0.2 in /frontend
2026-07-23 19:47:02 -04:00
Georges-Antoine Assi
d06a2cb76b Merge pull request #3927 from rommapp/dependabot/npm_and_yarn/frontend/fast-uri-3.1.4
build(deps-dev): bump fast-uri from 3.1.2 to 3.1.4 in /frontend
2026-07-23 19:43:08 -04:00
Georges-Antoine Assi
60b3e84767 Merge pull request #3923 from rommapp/feature/scan-settings-in-user-menu
Add Scan Settings to the user dropdown menu
2026-07-23 19:42:31 -04:00
Georges-Antoine Assi
bb1ce5635c Merge pull request #3920 from rommapp/fix/ejs-default-settings-fallback
Keep config.yaml EmulatorJS core settings active after user changes settings
2026-07-23 19:37:15 -04:00
dependabot[bot]
73530006bc build(deps-dev): bump fast-uri from 3.1.2 to 3.1.4 in /frontend
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.2 to 3.1.4.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](https://github.com/fastify/fast-uri/compare/v3.1.2...v3.1.4)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-23 23:36:16 +00:00
dependabot[bot]
6364d475b0 build(deps): bump linkify-it from 5.0.1 to 5.0.2 in /frontend
Bumps [linkify-it](https://github.com/markdown-it/linkify-it) from 5.0.1 to 5.0.2.
- [Changelog](https://github.com/markdown-it/linkify-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/markdown-it/linkify-it/compare/5.0.1...5.0.2)

---
updated-dependencies:
- dependency-name: linkify-it
  dependency-version: 5.0.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-23 23:36:14 +00:00
Zurdi
873053ae45 Merge pull request #3922 from rommapp/fix/v2-backdrop-filter-lightningcss
fix(v2): restore backdrop-filter blur in production builds
2026-07-24 01:34:55 +02:00
Georges-Antoine Assi
6d5c4acf86 cleanup 2026-07-23 19:30:53 -04:00
zurdi
23b0217329 refactor(frontend): drive CSS targets from a shared .browserslistrc
Replace the hardcoded `build.cssTarget` version list with a single source
of truth. The browser baseline (Tailwind v4's floor) now lives in
`.browserslistrc` as `>=` floors, and vite.config derives the esbuild-style
`cssTarget` Lightning CSS needs from it. Version data comes from
caniuse-lite instead of being pinned in the build config, and any other
tool reads the same file.

No behavior change: the derived targets resolve to the same set, so the
production build still emits both `-webkit-backdrop-filter` and the
standard property for every glass surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 22:57:09 +00:00
Georges-Antoine Assi
ee2d9ae7b6 Add Scan Settings to the user menu Library group
Scan Settings was reachable only through the settings sidebar. Add it
to the user dropdown's Library group, mirroring the sidebar's order,
icon, and platforms.write gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 18:45:10 -04:00
zurdi
95b337288c Merge remote-tracking branch 'origin/master' into fix/v2-backdrop-filter-lightningcss 2026-07-23 22:38:23 +00:00
Georges-Antoine Assi
ca455778da Merge pull request #3919 from rommapp/feature/netplay-username-from-account
Default EmulatorJS netplay username to the RomM account
2026-07-23 18:20:41 -04:00
zurdi
9e529150f8 fix(v2): restore backdrop-filter blur in production builds
Vite 8 switched the default CSS minifier from esbuild to Lightning CSS,
which treats `backdrop-filter` and `-webkit-backdrop-filter` as the same
property and keeps only the last declared one. Every v2 glass surface
declared the standard property first and the `-webkit-` twin second, so
the minifier dropped the standard `backdrop-filter` and kept only the
`-webkit-` alias. Chrome, Edge and Firefox do not support that alias, so
the blur silently disappeared on the navbars, RMenus and every other
glass surface in the built image (dev was unaffected because it does not
minify CSS).

Fix by letting Lightning CSS manage the prefixes:
- Add `build.cssTarget` so the minifier auto-prefixes from the standard
  property. This is the only knob that drives the minify path
  (`css.lightningcss.targets` is ignored there).
- Remove all hand-written `-webkit-backdrop-filter` declarations, which
  were the trigger and are now generated automatically for Safari.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 22:14:25 +00:00
Georges-Antoine Assi
fa63d7b5b5 Merge pull request #3917 from rommapp/feature/scan-region-mode
Add scan.priority.region_mode to let config regions drive media selection
2026-07-23 18:11:18 -04:00
Georges-Antoine Assi
36b7c228bc Address review: guard region_mode type and scope it to media
Non-string region_mode values (YAML list/mapping) now take the
warn-and-fallback path instead of raising TypeError on the frozenset
membership check during startup.

get_preferred_regions only applies prefer_config reordering when
selecting media (for_media=True); name and release-date selection keep
the rom-tags-first ordering, matching the documented scope.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 17:52:44 -04:00
Georges-Antoine Assi
47fb79630c cleanup 2026-07-23 17:11:23 -04:00
Georges-Antoine Assi
36e86dce30 Merge pull request #3918 from rommapp/fix/duplicate-media-screenshots
Stop storing fanart and title_screen twice when screenshots are enabled
2026-07-23 17:09:03 -04:00
Georges-Antoine Assi
b100392db2 Merge pull request #3916 from rommapp/fix/playmatch-health-check
Fix Playmatch health check failing on plain-text response
2026-07-23 16:52:43 -04:00
Georges-Antoine Assi
810854ad93 Keep config.yaml EmulatorJS defaults active after user setting changes
EmulatorJS' preGetSetting short-circuits to the saved-settings
localStorage object once any setting or control was changed, returning
undefined for every key the user never touched. That silently dropped
the config.yaml defaults passed via EJS_defaultOptions (webgl2Enabled,
rewindEnabled, core options) while the settings menu still displayed
them as active. Trap the EJS_emulator assignment and patch the
instance so unsaved keys fall back to the defaults per-setting, then
recompute the values the constructor captured before the patch could
take effect.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:49:19 -04:00
Georges-Antoine Assi
00fe9ccddb Default EmulatorJS netplay username to the RomM account
EmulatorJS keeps the netplay player name in memory only and shows its
name popup whenever netplay.name is unset, forcing users to retype a
name every session. Preset it from the logged-in RomM username in the
existing netplay override block, so the popup is skipped and the
account name is used automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:48:21 -04:00
Georges-Antoine Assi
6666019ce5 Stop duplicating fanart and title_screen into screenshots
ScreenScraper scraping added the fanart and title-screen URLs to
url_screenshots even though the same images are persisted to their
dedicated fanart/ and title_screen/ media folders, downloading and
storing every image twice. Restrict url_screenshots to the actual
screenshot media type; the dedicated media still renders in the artwork
gallery. The gamelist handler had the same pattern with title_screen
and gets the same fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:47:22 -04:00
Georges-Antoine Assi
67eab49a72 Add scan.priority.region_mode to prefer config regions for media
New opt-in config key scan.priority.region_mode with values
prefer_rom_tags (default, current behavior) and prefer_config. With
prefer_config, the configured region priority outranks the rom's
filename region tags when selecting ScreenScraper media, and the rom's
own tags remain the fallback when the configured regions have no media.
Unknown values warn and fall back to prefer_rom_tags, and the key
survives runtime config-file rewrites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:46:38 -04:00
Georges-Antoine Assi
a82615f4a7 Treat Playmatch plain-text health response as healthy
The Playmatch /api/v2/health endpoint returns the plain-text body
"Healthy", but heartbeat() routed it through the JSON-parsing
_request(), so decoding always failed and the Metadata Sources page
showed "Connection failed" for a healthy service. Do a raw GET and
treat any 2xx response as healthy, matching the Hasheous handler.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:45:54 -04:00
Georges-Antoine Assi
a144d117e8 Merge pull request #3910 from Spinnich/fix/server-stats-breakdown-perf
perf(stats): aggregate Server Stats breakdowns from roms_facets
2026-07-23 16:04:55 -04:00
Georges-Antoine Assi
c1065f3be1 fix migrations 2026-07-23 15:59:47 -04:00
Georges-Antoine Assi
e2827b9886 Merge branch 'master' into fix/server-stats-breakdown-perf 2026-07-23 15:50:08 -04:00
Georges-Antoine Assi
5744e2e518 Merge pull request #3896 from tmgast/feature/music-playlists
Add music favorites and playlists API
2026-07-23 15:14:54 -04:00
Georges-Antoine Assi
1bdd77661e cleanup 2026-07-23 14:44:56 -04:00
Spinnich
70478c88d3 fix(stats): degrade gracefully when the stats breakdown fetch fails
The v2 Server Stats view loads the summary first, then the heavier
per-platform breakdown as a second request. A rejection from that second
request propagated out of the async lifecycle hook as an uncaught error
instead of leaving the summary and platform rows usable. Catch it so the
page degrades to partial data.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 18:42:18 +00:00
Spinnich
f69e4756a7 perf(stats): aggregate server-stats breakdowns from roms_facets
The Server Stats page ran two full scans of the multi-gigabyte `roms`
table on every visit: the metadata-coverage breakdown counted eleven
provider-id columns per platform, and the region breakdown pulled every
row's regions into Python. Both were returned in the same request as the
cheap summary counts, so the whole page stayed blank until they finished.

Mirror the provider match ids into the narrow `roms_facets` table
(migration 0102, kept in sync by the same triggers as the existing facet
columns) and read both breakdowns from it, so neither query touches
`roms`. Split the v2 Server Stats view into a summary-first request and a
separate breakdown request so the six top cards render immediately.

Fixes #3901

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 17:27:09 +00:00
Georges-Antoine Assi
6b2e805b0d Merge pull request #3906 from Spinnich/fix/server-stats-duplicate-slug-key
Fix/server stats duplicate slug key
2026-07-23 12:50:06 -04:00
Georges-Antoine Assi
c99154a5d0 Merge pull request #3903 from rommapp/fix/emit-restored-roms-during-platform-scan
fix(scan): emit a client update for ROMs that are no longer missing
2026-07-23 12:48:24 -04:00