Commit Graph

10313 Commits

Author SHA1 Message Date
Georges-Antoine Assi
dbf29f9feb Merge pull request #3638 from Spinnich/fix/filter-values-cache-schema-version
fix(roms): namespace filter-values cache by schema version
2026-06-30 08:28:03 -04:00
Georges-Antoine Assi
8c370fbc22 Merge branch 'master' into fix/filter-values-cache-schema-version 2026-06-30 08:22:19 -04:00
Georges-Antoine Assi
067711b9d7 use version as shcema key 2026-06-30 08:22:16 -04:00
Spinnich
a08b7dfbda fix(roms): namespace filter-values cache by schema version
The /api/roms filter_values dict is cached in Redis keyed only by a
runtime data-version that survives app upgrades. When a filter field is
added (e.g. tags), entries written by the previous version lack the new
key, so the response fails validation (filter_values.tags "Field
required") and returns 500 until the entry's 7-day TTL elapses or a scan
invalidates it.

Embed a schema version in the cache key so reads after an upgrade ignore
entries written under the old shape and recompute instead. Pre-namespace
keys are bypassed for free by the changed key format. Bump
ROM_FILTERS_CACHE_SCHEMA_VERSION whenever the cached dict gains or loses
a field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 10:47:16 +00:00
Georges-Antoine Assi
78e08ee54f Merge pull request #3634 from rommapp/claude/fervent-davinci-oc3y6f
Add Artwork subtab to Media tab with scraped art gallery
5.0.0-alpha.2
2026-06-29 19:38:35 -04:00
Georges-Antoine Assi
a0f9535d45 update langs 2026-06-29 19:36:35 -04:00
Georges-Antoine Assi
9c7b12b983 Merge pull request #3632 from rommapp/claude/github-issue-3574-eiapde
Fix ROM upload temp directory to use RESOURCES_BASE_PATH
2026-06-29 19:34:57 -04:00
Georges-Antoine Assi
9858d5bf60 Merge branch 'master' into claude/fervent-davinci-oc3y6f 2026-06-29 19:29:54 -04:00
Georges-Antoine Assi
69aad95282 remove comments 2026-06-29 19:28:13 -04:00
Georges-Antoine Assi
253fd33e30 Merge branch 'master' into claude/github-issue-3574-eiapde 2026-06-29 19:26:08 -04:00
Georges-Antoine Assi
0cefc0eb73 Merge pull request #3631 from rommapp/claude/github-issue-3617-l1l0cu
Add ROM revision field to game details overview
2026-06-29 19:25:51 -04:00
Georges-Antoine Assi
dd591ba298 Merge pull request #3635 from rommapp/fix/sibling-platform-id-detached-load
fix(backend): load platform_id on siblings to avoid DetachedInstanceError
2026-06-29 19:22:01 -04:00
Georges-Antoine Assi
c69e77ba0a fix(backend): load platform_id on siblings to avoid DetachedInstanceError
The single-rom endpoints (`/{id}/simple`, `/{id}`) build SiblingRomSchema
from the eager-loaded `sibling_roms` relationship. `_visible_siblings`
filters those siblings with `perms.can_see_rom(s.id, s.platform_id)`, but
the `with_details` loader restricts sibling columns via `load_only` and did
not include `platform_id`. Reading the deferred attribute after the session
closed triggered a lazy load on a detached instance, raising
DetachedInstanceError.

Add `Rom.platform_id` to the sibling `load_only` so the permission check
reads an already-loaded column.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 18:10:03 -04:00
Claude
4e07aa45bb feat(frontend-v2): surface scraped videos on the Overview tab
Extract the art-asset resolution into a shared util (resolveRomArtwork)
so the Media tab's Artwork subtab and the Overview tab stay in sync, and
add a Videos section to the Overview tab for the scraped preview clips.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFq1CxyxqM5nBCY6Tfgyv1
2026-06-29 14:46:34 +00:00
Claude
c1c1797abb fix(frontend-v2): expose scraped art assets in Media tab
The V2 game details view only surfaced screenshots and title screens,
hiding the majority of scraped art (bezel, logo, marquee, box art, fan
art, mix images) and the scraped videos that the classic GUI showed in
its overview carousel.

Add an "Artwork" subtab to the Media tab: a read-only, labelled gallery
of every scraped art asset that doesn't already have its own surface.
Images open a fullscreen lightbox; videos play inline. ScreenScraper is
preferred with gamelist fallbacks, mirroring v1's MediaCarousel.

Closes #3613

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFq1CxyxqM5nBCY6Tfgyv1
2026-06-29 14:40:08 +00:00
Claude
f9a5537efc fix(upload): store chunk temp dir under writable resources path
Chunked ROM uploads created their temp directory directly under
ROMM_BASE_PATH (/romm/tmp/uploads). The bare /romm directory is owned by
the image's romm user (1000:1000, mode 755), so containers running with a
custom UID/GID cannot create directories there, causing uploads to fail
with "PermissionError: [Errno 13] Permission denied: '/romm/tmp'".

Default the upload temp root to RESOURCES_BASE_PATH instead, which is a
writable mounted volume in those setups (this is why manual uploads, which
write under resources/, already worked). ROMM_TMP_PATH still overrides it.

Fixes #3574

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ficBAiEtYtZyBY8nWExKh
2026-06-29 14:36:09 +00:00
Claude
0e38eb4024 fix(frontend-v2): show revision tag on game Overview tab
The v2 game details Overview tab did not surface the parsed revision
tag (e.g. "Rev 1", "Rev B"), which the classic GUI showed in its Info
section. Add a Revision fact row to the Overview tab, sourced from the
ROM's revision field.

Closes #3617

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUiuFX615VBcwYT7xb6dsm
2026-06-29 14:35:41 +00:00
Georges-Antoine Assi
cdbad10ab5 Merge pull request #3629 from Spinnich/feat/filter-by-custom-tags
feat(roms): filter games by custom tags
2026-06-29 10:27:18 -04:00
Georges-Antoine Assi
9740793673 Merge pull request #3628 from rommapp/dependabot/uv/python-socketio-5.16.2
build(deps): bump python-socketio from 5.14.0 to 5.16.2
2026-06-29 10:10:42 -04:00
Georges-Antoine Assi
5fb6d97685 fix fmt 2026-06-29 10:06:06 -04:00
Georges-Antoine Assi
6b5300771a Merge pull request #3627 from rommapp/dependabot/uv/joserfc-1.6.7
build(deps): bump joserfc from 1.6.3 to 1.6.7
2026-06-29 10:04:48 -04:00
Zurdi
dab2545c0f Merge pull request #3605 from rommapp/chore/permissions-system-rework
feat: granular permission system (groups, overrides, per-entity hiding)
2026-06-29 14:05:15 +02:00
dependabot[bot]
d2d2b87a9f build(deps): bump python-socketio from 5.14.0 to 5.16.2
Bumps [python-socketio](https://github.com/miguelgrinberg/python-socketio) from 5.14.0 to 5.16.2.
- [Release notes](https://github.com/miguelgrinberg/python-socketio/releases)
- [Changelog](https://github.com/miguelgrinberg/python-socketio/blob/main/CHANGES.md)
- [Commits](https://github.com/miguelgrinberg/python-socketio/compare/v5.14.0...v5.16.2)

---
updated-dependencies:
- dependency-name: python-socketio
  dependency-version: 5.16.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 11:42:28 +00:00
Georges-Antoine Assi
558e1026af Merge pull request #3626 from rommapp/dependabot/uv/python-engineio-4.13.2
build(deps): bump python-engineio from 4.12.2 to 4.13.2
2026-06-29 07:40:00 -04:00
zurdi
9234efd386 Merge remote-tracking branch 'origin/master' into chore/permissions-system-rework
# Conflicts:
#	backend/handler/database/stats_handler.py
2026-06-29 11:33:03 +00:00
Spinnich
14a0a98661 feat(roms): filter games by custom tags
Adds a "Tag" gallery filter so a library can be narrowed by the custom
tags parsed from filenames (No-Intro / Redump nomenclature, e.g. Proto,
Beta, Demo), mirroring the existing data-derived multi-value filters
(regions, languages). Closes #3546.

Backend:
- New `_filter_by_tags` over `Rom.tags` with any/all/none logic; wired
  through filter_roms, get_roms_scalar, the /roms endpoint (tags +
  tags_logic), and the unscoped cache gate.
- Tags are data-derived, so the selectable list is surfaced via
  filter_values: added to _collect_filter_values, with_filter_values,
  get_rom_filters, and RomFiltersDict.
- Smart collections apply the criterion via get_smart_collection_roms.

Frontend (v1 + v2):
- Wired into the galleryFilter store, rom API service, request cache key,
  both filter drawers, v2 URL persistence, the v2 refetch watcher, and
  smart-collection serialization/summary + create dialog.
- Added the `platform.tag` key to all locales (distinct from the existing
  `platform.tags` section heading).

Tests:
- Backend handler (any/all/none + unknown-value), endpoint, filter_values,
  and smart-collection coverage.
- Frontend smartCollectionCriteria serialization/summary coverage.

AI assistance: implemented with Claude Code (Anthropic).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:29:12 +00:00
Georges-Antoine Assi
e8aebbf006 Merge pull request #3615 from Spinnich/feat/filter-by-metadata-provider
feat(roms): filter games by matched metadata provider
2026-06-29 07:12:40 -04:00
Spinnich
d546165814 style: normalize collections_handler.py to LF line endings
This was the only CRLF-encoded file in the backend; every other Python
source uses LF. The earlier minimal-diff workaround left it mixed, so
convert it fully to LF (the repo standard) for internal consistency.

No logic changes in this commit. The only behavioural change to this file
in the PR remains the two lines added to get_smart_collection_roms
(metadata_providers + metadata_providers_logic).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 10:44:54 +00:00
Spinnich
345a690c82 refactor(roms): deduplicate metadata-provider definitions (PR review)
Addresses review feedback on #3615:

- Backend: merge the new filter column map with stats_handler's
  `_METADATA_SOURCE_COLUMNS` into a single `METADATA_SOURCE_COLUMNS` in
  models/rom.py, imported by both. It's the union of the two prior sets,
  so the stats coverage breakdown now also reports `libretro`.
- Frontend: drop the duplicated provider list from utils; derive the
  filter options from the `METADATA_PROVIDERS` registry via
  `METADATA_PROVIDER_FILTER_OPTIONS` (added a `name` brand field). Both
  filter drawers import from the registry now.
- collections_handler.py: revert the stray CRLF->LF normalization so the
  diff is just the two smart-collection lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 10:35:59 +00:00
zurdi
e6225e582a refactor(permissions): replace get_permissions checks with assert_platform_visible and assert_rom_visible for better clarity and maintainability 2026-06-29 10:11:02 +00:00
Georges-Antoine Assi
f3ca3def72 Merge pull request #3623 from rommapp/claude/github-issue-3610-0wpp47
Fix ROM name handling in UNMATCHED scans to replace placeholders
2026-06-28 22:38:25 -04:00
Georges-Antoine Assi
41f77cd5b4 Merge pull request #3622 from rommapp/claude/github-issue-3621-i8o7r6
Normalize Sony serial codes to uppercase before cache lookup
2026-06-28 22:35:50 -04:00
Georges-Antoine Assi
ada593628a Merge pull request #3609 from rommapp/claude/github-issue-3600-l8pa3u
fix(ra): hash PSP compressed-ISO containers natively (#3600)
2026-06-28 22:35:09 -04:00
Georges-Antoine Assi
25d0bb38fb Merge pull request #3624 from rommapp/claude/issue-2319-investigation-y44bmi
Fix state/save injection timing and corruption in EmulatorJS
2026-06-28 22:34:52 -04:00
dependabot[bot]
a56e34671e build(deps): bump joserfc from 1.6.3 to 1.6.7
Bumps [joserfc](https://github.com/authlib/joserfc) from 1.6.3 to 1.6.7.
- [Release notes](https://github.com/authlib/joserfc/releases)
- [Changelog](https://github.com/authlib/joserfc/blob/main/docs/changelog.rst)
- [Commits](https://github.com/authlib/joserfc/compare/1.6.3...1.6.7)

---
updated-dependencies:
- dependency-name: joserfc
  dependency-version: 1.6.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 02:29:37 +00:00
dependabot[bot]
423b5e77c3 build(deps): bump python-engineio from 4.12.2 to 4.13.2
Bumps [python-engineio](https://github.com/miguelgrinberg/python-engineio) from 4.12.2 to 4.13.2.
- [Release notes](https://github.com/miguelgrinberg/python-engineio/releases)
- [Changelog](https://github.com/miguelgrinberg/python-engineio/blob/main/CHANGES.md)
- [Commits](https://github.com/miguelgrinberg/python-engineio/compare/v4.12.2...v4.13.2)

---
updated-dependencies:
- dependency-name: python-engineio
  dependency-version: 4.13.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 02:29:31 +00:00
Georges-Antoine Assi
aa3de6e396 Merge branch 'master' into claude/github-issue-3610-0wpp47 2026-06-28 22:29:27 -04:00
Georges-Antoine Assi
0f485b45eb Merge branch 'master' into claude/github-issue-3621-i8o7r6 2026-06-28 22:29:15 -04:00
Georges-Antoine Assi
04f6d29e26 Merge branch 'master' into claude/github-issue-3600-l8pa3u 2026-06-28 22:28:52 -04:00
Georges-Antoine Assi
e3c736dc80 Merge pull request #3625 from rommapp/rm-pytest-reports
Stop spamming PRs with coverage reports
2026-06-28 22:28:25 -04:00
Georges-Antoine Assi
c9779a6302 Stop spamming PRs with coverage reports 2026-06-28 22:13:57 -04:00
Georges-Antoine Assi
6b423e2d34 extend catch except 2026-06-28 21:48:50 -04:00
Claude
e8a7ae3fee fix(emulation): make save state capture and restore reliable
Save states were inconsistently saved and frequently failed to load,
especially on threaded cores (SNES, N64). Two timing races were the
cause:

- On game start, a selected state was applied after a fixed 10ms delay
  with no check that the core was ready. Heavier cores aren't booted in
  that window, so the state applied partially and left a black screen.
  Replace the fixed delay with a gameManager readiness poll plus a short
  settle window before applying the state (mirrors the console player).

- The Save & Quit handler read the state from a running emulator. On
  threaded cores the worker thread mutates emulator memory while
  getState() reads it, producing torn/corrupt buffers that are then
  stored permanently. Capture the screenshot while running, then pause
  before serializing the state and save file.

Also refuse to upload zero-length state buffers so a failed capture
can't overwrite good states on the server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PoAdK2fmqHGmGuXWaKN1HT
2026-06-28 20:00:38 +00:00
Claude
0b20ca331e fix(scan): replace placeholder filename with matched provider name
A ROM's name defaults to its raw filename (extension included) when it is
first discovered. On UNMATCHED and UPDATE rescans, the block that preserves
existing base fields kept that placeholder name even after a metadata
provider finally matched the ROM, leaving the filename (with its ".zip"
extension and region tags) as the title.

Treat a name equal to the ROM's filename as "no name" so a freshly matched
provider name replaces it, while still preserving user-edited names.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Shf4omKSP6dHC3dC2Jjg7b
2026-06-28 18:31:30 +00:00
Claude
5845971331 fix: normalize Sony serial casing before Redis lookup
Sony serial codes captured from filenames preserved their original casing.
Dash-separated slug filenames (e.g. game-u-slus-00431-.rar) yield a
lowercase serial, but the serial index keys in Redis are uppercase, so the
lookup missed and the ROM went unidentified.

Uppercase the serial before the hget so PS1/PS2/PSP serial matching works
regardless of filename casing.

Closes #3621

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtzKWXK7nbUDgEmHxpnKc
2026-06-28 18:21:16 +00:00
Georges-Antoine Assi
699d9ee670 Merge pull request #3604 from rommapp/claude/github-issue-3591-gedicl
fix(v2): stop gamepad B/cancel from backing out of controller test and games
2026-06-28 08:11:15 -04:00
zurdi
7d45795408 fix(permissions): address gantoine review + Postgres-safe single migration
Visibility-coverage gaps (404-mask hidden entities, mirroring the existing
delete/read paths):
- update_rom (PUT /roms/{id}) and update_rom_user (PUT /roms/{id}/props)
- add_firmware: platform-hide now cascades to firmware uploads
- patch_rom: resolve the parent rom of both the base and patch files and
  404 when hidden, so a hidden rom's bytes can no longer be streamed back
- activity feeds (get_all_activity / get_rom_activity): drop sessions whose
  rom is hidden from the caller

Migration: make the role enum -> varchar narrowing Postgres-safe. The cast
now uses postgresql_using, the orphaned native role type is dropped on
upgrade, and downgrade recreates it explicitly (create_type=False) before
re-typing the column. Verified up/down/up on Postgres 16 and MariaDB.

Also collapses the two permission migrations into a single 0092 and notes
the override own_only replacement granularity limit in the resolver.

AI assistance: implemented with Claude Code (review-fix pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 22:10:00 +00:00
zurdi
5303130d15 Merge remote-tracking branch 'origin/master' into chore/permissions-system-rework 2026-06-26 15:35:41 +00:00
Spinnich
983f016efe feat(roms): filter games by matched metadata provider
Adds a "Metadata provider" gallery filter so a library can be narrowed by
which providers each ROM matched (IGDB, MobyGames, ScreenScraper, etc.),
mirroring the existing multi-value filters (player count, age rating).

Backend:
- New `_filter_by_metadata_providers` keyed off each provider's id column
  on Rom, with any/all/none logic; wired through filter_roms,
  get_roms_scalar, the /roms endpoint, and the unscoped cache gate.
- Smart collections apply the criterion via get_smart_collection_roms.
- Unknown provider slugs are ignored (no-op) so stale bookmarks or
  hand-edited URLs don't error.

Frontend (v1 + v2):
- Shared METADATA_PROVIDER_OPTIONS registry; provider list is a fixed set
  rather than data-derived, so options are static.
- Wired into the galleryFilter store, rom API service, request cache key,
  both filter drawers, v2 URL persistence, the v2 refetch watcher, and
  smart-collection serialization/summary.
- Added the `platform.metadata-provider` key to all locales.

Tests:
- Backend handler, endpoint, and smart-collection coverage (any/all/none
  plus unknown-slug).
- Frontend smartCollectionCriteria serialization/summary coverage.

Also normalized collections_handler.py to LF (it was the only CRLF file in
the backend, which tripped git-diff-check on the edited lines).

AI assistance: implemented with Claude Code (Anthropic).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 13:52:19 +00:00
zurdi
4e686e1d74 fix(permissions): address PR review (Copilot + adversarial) findings
Resolves the CI blocker and a cluster of opt-out visibility "fail-open"
gaps surfaced in review of the granular permission system.

Security / correctness:
- admin oauth_scopes projection keeps canonical FULL_SCOPES order
  (order_scopes) instead of sorting alphabetically, fixing the red
  test_user.py::test_admin on MariaDB + Postgres.
- default-group hides no longer fail open: the resolver resolves the
  effective (own-or-default) group before the hidden-entity lookup.
- /roms/by-hash and /roms/by-metadata-provider now 404-mask hidden roms.
- USERS-entity grant no longer enables admin creation: add_user and
  invite-link require a real admin to mint admin accounts.

Visibility leaks closed on secondary read paths:
- feeds, sibling roms (list query + single-rom schemas), /stats counts
  and per-platform breakdowns, collection rom_ids/rom_count, search_rom.

Hardening / cleanups:
- firmware/platform PUT 404-mask hidden entities; group rename conflict
  returns 400 not 500; guard against removing the last default group;
  kiosk read-only enforced at the fine layer; add_hidden_entity rejects
  non-cascading entity types.

Frontend:
- permissionGroups.ensureLoaded coalesces concurrent callers on one
  in-flight request; permissions.setGrants resets isAdmin/hidden;
  CreateUserDialog no longer orphans a user when group assignment fails;
  HiddenGamesPicker search rows are native buttons (keyboard/gamepad);
  invite-role labels and group swatch aria-label use i18n; drop dead code
  (originalRole, unused permissionsApi export).

AI assistance: changes authored with Claude Code (Claude Opus), driven by
the Copilot review and a multi-agent adversarial review, then verified
(backend pytest, frontend typecheck/vitest, i18n parity, trunk).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 12:37:58 +00:00