Commit Graph

2439 Commits

Author SHA1 Message Date
Georges-Antoine Assi
5837ac3df9 refactor(config): name the two default dir lists for what they exclude
DEFAULT_EXCLUDED_DIRS only ever seeded EXCLUDED_PLATFORMS, but its name
implied it was the general directory list, which is how the media folders
came to be added to it in the first place. Rename it and its superset to
DEFAULT_EXCLUDED_PLATFORM_DIRS and DEFAULT_EXCLUDED_MULTI_FILE_DIRS, and
spell out what a multi-file ROM is.

DEFAULT_EXCLUDED_FILES and DEFAULT_EXCLUDED_EXTENSIONS keep their generic
names: each still feeds both a single-file and a multi-file-parts exclusion.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 16:42:43 -04:00
Georges-Antoine Assi
65b2a050c1 refactor(gamelist): give the ES-DE media folder names one home
Fold the exporter's folder map and the importer's ESDE_MEDIA_MAP into a
single GAMELIST_MEDIA_DIRS, so writing, reading and skipping a media type
is one edit. This also picks up thumbnails/, which the scan exclusions were
missing, and drops the hand-appended "images" literal.

Serve the multi-file defaults pre-unioned as DEFAULT_EXCLUDED_MULTI_DIRS so
neither UI has to re-join two lists; v1 was still mapping EXCLUDED_MULTI_FILES
to DEFAULT_EXCLUDED_DIRS and rendering the media dirs as deletable.

Collapse the per-tag asset loop and the bespoke <mix> block into one table
keyed by tag, and skip fnmatch for the exclusion patterns that hold no glob
characters, now that the multi-file list is more than twice as long.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 16:19:55 -04:00
Georges-Antoine Assi
841a7a2f9f fix(settings): scope a cleanup to every selected platform
The cleanup tasks took a single platform_id while both Missing tabs
offer a multi-select, so picking two platforms ran the unscoped
cleanup over the whole library. The confirmation dialog still named
the selection, so the tab deleted more than it said it would.

Take platform_ids on both cleanup tasks and filter firmware by the
whole list, so what runs matches what the dialog names.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:56:56 -04:00
Sam Dornan
e64944f2e5 fix(auth): build invite links from ROMM_BASE_URL
The invite link was assembled client-side from window.location.origin, so
generating one while browsing over localhost or a LAN address produced a
link the recipient could not open. The API now returns the full link built
from ROMM_BASE_URL, and the UI falls back to the origin when that setting
points somewhere non-shareable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 20:23:57 -05:00
Georges-Antoine Assi
372d34752d fix(scan): report only newly discovered firmware
The scan:scanning_platform payload carried the platform's total
firmware_count, so the scan view showed a firmware chip and expanded the
panel on every re-scan of an unchanged library. The panel body only lists
ROMs, leaving an empty card.

Emit the firmware count scoped to the running scan instead, and key the
auto-expand off the ROM list alone.

Fixes #4049

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:19:58 -04:00
Georges-Antoine Assi
57f4fd21d0 cleanup 2026-07-28 23:01:07 -04:00
Georges-Antoine Assi
ad07bafbd1 fix(tasks): load the task list when the tasks page opens
The list was fetched once at app boot, inside a bootstrap that runs
before anyone is logged in. /tasks needs the tasks.run scope, so any
session established after boot (any login without a reload) left the
watcher, scheduled and manual lists empty for the rest of the page load,
in both UIs. For a logged-in non-admin the same call 403'd on every page
load and tripped the interceptor's redirect to login.

Fetch on mount from the pages that need it instead.

Fixes #3981

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 22:22:13 -04:00
Georges-Antoine Assi
7d844c735d add miximage v2 support gamelist 2026-07-25 09:13:39 -04:00
Georges-Antoine Assi
0e05f94894 Render miximage_v2 cover style in v1
The boxartStyle setting is shared across UI versions, so a value picked
in v2 reaches v1 galleries. Teach v1 to render it (square ratio, ss-only
art resolution, hover video) without adding it to the v1 selector.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:06:50 -04:00
Georges-Antoine Assi
de63580fcf trunk fmt everything 2026-07-19 20:35:51 -04:00
Georges-Antoine Assi
7caa3f1297 fix(ui): remove cover-art attribution link on details pages
The "Cover art provided by X" line linked to rom.url_cover, which for
ScreenScraper contains a media download URL with embedded credentials.
Render the source name as plain text so credentials are not exposed in
the UI, while the URL stays stored in the database unchanged.

Fixes #3612

Generated-By: PostHog Code
Task-Id: 038e1de3-16ac-4f2b-8ae0-b4dade2f8ef9
2026-07-13 12:59:02 -04:00
Georges-Antoine Assi
56522d6207 fix: show total versions count in v1 gallery sibling tooltips
The tooltip counted only sibling_roms (other versions), producing
"1 version(s)" for a group that actually holds 2. Use the localized
rom.versions-count key with sibling_roms.length + 1, matching the v2
SiblingBadge, so it reads the true total with no "(s)" suffix.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 19:43:27 -04:00
Georges-Antoine Assi
1699800da5 i18n: use existing key for versions filter summary label
Replace the hard-coded "Versions" token in the smart-collection filter
summary with the localized platform.show-duplicates key so non-English
locales don't show an English-only label.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 19:41:41 -04:00
Georges-Antoine Assi
055487f0dc i18n: rename "duplicates" filter to "versions" in the UI
The "Show duplicates" filter and related sibling-ROM labels were
confusing (see issue). Rename the user-visible text to "versions",
matching the term already used for sibling ROMs elsewhere in the UI
(switch version, "{n} versions", "Group versions of the same ROM").
The API contract and internal identifiers are left untouched.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 18:41:23 -04:00
Georges-Antoine Assi
e0fc0badb8 simplification 2026-07-04 12:49:31 -04:00
nendo
8a94854b81 Add a music query API for soundtracks
RomM stores soundtracks but exposes no way to consume them as a music library: a
client has to enumerate ROMs and pull each one's tracks individually, and the
per-track metadata lives in the `rom_files.audio_meta` JSON blob, which is
unindexable on MariaDB, so any library-wide filter or sort degrades to a full
scan.

This adds a queryable, music-first API for soundtracks, backed by a typed and
indexed `track_meta` table migrated from that JSON.

It also lets users upload soundtracks, manuals, and screenshots to any ROM, not
only folder-based ones. When the target is a single-file ROM, the client warns
that the upload will migrate it to a multi-file (folder) structure, then performs
that migration in place automatically.
2026-07-02 11:16:07 +09: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
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
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
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
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
80a968183d Move ROM patcher into a GameDetails tab, drop /patch route
Convert the standalone v2 Patcher view into a PatcherTab feature composite
rendered inside GameDetails (gated on the ROM carrying nested files), and
remove the dedicated rom/:rom/patch route along with every navigation
entry that led to it.

v2: remove the FilesTab button, the GameActions menu item, and
useGameActions.patch/canPatch; drop the route binding and named view.
v1 (frozen, removed per request): delete views/Patcher.vue, the AdminMenu
patcher item, and navigation store goPatcher.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 18:11:02 -04:00
Georges-Antoine Assi
52163633e5 Merge branch 'master' into claude/server-side-rom-patching-EaQck 2026-06-23 07:01:07 -04:00
Georges-Antoine Assi
8922c2dd12 changes forom bot review 2026-06-18 13:27:41 -04:00
Georges-Antoine Assi
a38ebe29b5 Preserve custom name_sort_key; gate derivation on "still derived"
Drop the name_sort_key_custom flag/migration in favour of a flagless rule: a
key is "custom" when it no longer equals compute(name). Apply that consistently
across all three write paths so a manual sort key survives renames while a
derived key keeps following the name:

- @validates re-derives on name assignment only when the stored key still
  matches the derived value; direct name_sort_key assignment stores a
  normalized custom key (or reverts to derived when cleared). Handles both
  kwarg orders at construction.
- update_rom mirrors the same check for the bulk update() path it bypasses.
- The edit endpoint only writes the key when the user actually changed the
  field, delegating the untouched case to update_rom.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:30:40 -04:00
Georges-Antoine Assi
cd19d723fa Merge sort_name into name_sort_key with custom-override flag
Collapse the separate `sort_name` column into `name_sort_key`, which is now
the single user-settable sort field: always normalized and indexed for fast
ordering, derived from `name` by default, and overridable. A new
`name_sort_key_custom` boolean marks user/metadata overrides so they survive
renames and rescans.

- Drop the `roms.sort_name` column; repurpose migration 0085 to add
  `name_sort_key_custom`.
- Derive the key via `@validates("name")` unless pinned custom; the edit
  dialog, unmatch flow, and ES-DE gamelist <sortname> set custom keys.
- update_rom / scan_rom keep the columns in sync explicitly (bulk update and
  construction bypass / reorder the validator).
- Frontend: edit field drives name_sort_key (empty when auto), api sends the
  override only when custom, regenerated types updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 10:34:21 -04:00
Georges-Antoine Assi
0d8a0a2ab2 Merge branch 'master' into copilot/support-sortname-tag-es-de 2026-06-18 09:04:17 -04:00
Georges-Antoine Assi
4feb71a697 fix type errors 2026-06-18 08:07:07 -04:00
Georges-Antoine Assi
4bacdc5f09 Merge branch 'master' into fix/search-performance-improvements 2026-06-17 17:39:47 -04:00
Daniel Bonofiglio
d5ffeeeddb fix(search): full-text indexes+caching
Adds a few new indexes to handle full-text searches instead of doing
`ILIKE` matching, improving performance substantially.
Alongside that, a few other things were done in order to improve search
performance, such as caching filter values so they're not computed on
each request to /api/roms. Overall, this should have a very noticeable
impact on large collections when using the search feature.
2026-06-16 20:39:15 -03: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
036cf108f4 sinmplify siblings 2026-06-08 10:25:27 -04:00
Georges-Antoine Assi
619e03ab32 fix: stop serving private user assets via unauthenticated nginx static route
The default Docker image symlinked /romm/assets into the nginx static web
root (/assets/romm/assets), where it was served by an unauthenticated
`location /assets { try_files ... }` block. /romm/assets holds private user
data (save files, save states, screenshots, avatars) that is meant to be
accessible only through the authenticated /api/raw/assets/{path} route
(Scope.ASSETS_READ). The static symlink bypassed that protection, letting any
unauthenticated caller read another user's files given a (guessable) path.
Avatar URLs leaked the hex user ID through the same static route, making path
construction straightforward.

Fix:
- Drop the /romm/assets symlink from the Docker image build and both
  entrypoint scripts; only /romm/resources (public cover art, screenshots,
  manuals) remains statically served.
- Point the frontend avatar URLs at the authenticated /api/raw/assets/ route
  instead of /assets/romm/assets/. Browser <img> loads authenticate via the
  existing session cookie.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:34:30 -04:00
zurdi
67a059a0be Add beta badge to New UI button in UI version toggle 2026-06-05 13:15:25 +02:00
copilot-swe-agent[bot]
3f98aa16f4 feat: expose rom sort_name in edit form
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-31 16:24:32 +00:00
zurdi
fb10a51bb8 Refactor soundtrack metadata types to use RomFileAudioMetaSchema for improved consistency 2026-05-28 09:38:28 +00:00
zurdi
f09515e4fa feat: update types for rom handling in QR dialog and related components 2026-05-27 19:54:56 +00:00
zurdi
31f01900d7 feat: add support for recalculating file hashes in metadata refresh options and display in file details 2026-05-26 15:04:56 +00:00
zurdi
8f48c92cbf Merge remote-tracking branch 'origin/master' into chore/frontend-v2 2026-05-26 07:44:59 +00:00
Georges-Antoine Assi
5e8fac36a7 Merge branch 'master' into claude/awesome-gates-NUpke 2026-05-25 11:10:04 -04:00
Georges-Antoine Assi
9a87348c22 cleanup 2026-05-25 11:02:35 -04:00
zurdi
17ea8da23d Merge remote-tracking branch 'origin/master' into chore/frontend-v2 2026-05-25 07:56:38 +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
4a89dadb55 update scna pages 2026-05-22 22:32:33 -04:00
Georges-Antoine Assi
f84796da08 Merge pull request #3385 from Spinnich/pr/chd-raw-hashing
feat(hashing): compute raw CHD hashes and route disc-data SHA1 to Hasheous
2026-05-18 14:52:54 -04:00
Georges-Antoine Assi
e6d4ede939 cleanup 2026-05-18 07:40:59 -04:00
Georges-Antoine Assi
c97ec449e2 drop more aspect ratrio 2026-05-17 14:07:46 -04:00