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>
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>
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>
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>
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>
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>
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>
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
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
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
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
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.
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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.