Two independent faults left the Media tab's Manual panel as an empty frame
on phones:
* vue3-pdf-app wires its toolbar controls by `id` on mount and abandons the
whole viewer when one is missing, so hiding the prev/next page buttons with
`v-if` at the xs breakpoint stopped any page from ever being laid out. The
buttons now always render and are hidden with CSS instead.
* RDropzone declares `inheritAttrs: false` without ever binding `$attrs`, so
the sizing class its consumers pass was dropped. On desktop the fixed-height
chain hid that; on mobile, where the details view scrolls as one document,
nothing gave the viewer a height and it collapsed to the toolbar.
The dropzone now forwards attrs, the manual viewer takes an explicit viewport
slice on mobile, and the soundtrack panel opts out of the zero-basis fill
there so it keeps sizing to its content.
Fixes#4046
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The widget nulled its pick on any error, so a transient failure on
reroll swapped a good pick for the "No games loaded yet" copy. Failures
now keep the current pick and surface an error snackbar, the card's
fallback text distinguishes a failure from an empty library, and a page
that comes back empty (the cached id index drifting from the database)
is retried once before it counts as one.
Both calls also opt out of the char index, filter values and rom id
index, which the endpoint returns by default and which span the whole
library: a reroll drops from ~463KB to ~15KB on a 75k-rom library.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Drop the "Open" button: the cover and title now link to the rom. The
freed space shows the platform and the release year / region so the
pick is identifiable when a library holds several variations of the
same title. Reroll moves to the card's top-right action slot and
shows a readable die face that changes on every roll.
Closes#4048
Co-Authored-By: Claude Opus 5 (1M context) <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 hash search tests reached membership through
`get_smart_collection_roms`, which no longer exists now that a smart
collection is served as a composed query. Ask for the collection the way
the gallery does instead, so the criterion is still exercised end to end.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
v2 exposed the "Show regions" and "Show languages" settings but nothing
consumed them, so covers lost the region and language emblems that 4.x
showed. Add a CardFlags overlay to GameCard: up to three emoji per chip
with the full list in the hover title, fading out under the hover overlay
so it never collides with the action row.
Fixes#4027
The folder-mapping table lists FS_PLATFORMS from the heartbeat snapshot
taken at app init, so a folder created after that only showed up after a
full page reload. Refetch the heartbeat when the section mounts.
Fixes#4035
Hashed asset names change on every deploy, so a tab left open across an
upgrade 404s on its next lazy import and goes blank until the user
reloads by hand. Listen for `vite:preloadError` and for router
dynamic-import failures, and reload once. A session-scoped timestamp
guards against a reload loop when an asset is genuinely missing.
Fixes#4034
The match dialog covers the gallery card it was opened from, hiding the
file name, which is the one piece of ground truth when re-matching a
mismatched game. Show it next to the dialog title, truncated to a single
line with the full name in the hover title.
Fixes#4038
Provider chips without a link (HowLongToBeat, Libretro, Flashpoint) were
styled with `pointer-events: none`, which also suppressed the native
`title` tooltip, leaving those icons unlabelled. Drop only the pointer
affordance and keep the chip hoverable.
Fixes#4040
Protected routes answered 403 both when there was no session and when the
authenticated user lacked the required scope. The frontend read every 403
as session expiry, cleared the session cookie and redirected to /login, so
a permission denial (for instance saving a state without the save scope)
tore down whatever the user was doing, including a running emulator.
`protected_route` now uses its own scope guard that raises 401 with a
`WWW-Authenticate` header when the caller is unauthenticated, and 403 when
the caller is authenticated but under-scoped. The axios interceptor only
redirects on 401 and lets 403s surface inline to the caller, refreshing the
CSRF cookie when the backend rejected the CSRF token.
Endpoint assertions for unauthenticated requests move from 403 to 401;
authenticated under-scoped cases stay 403.
Fixes#4045
Synology NAS shares carry a `#recycle` folder at the root of every share,
which RomM picked up as a platform directory. Add it to
DEFAULT_EXCLUDED_DIRS, and make the exclusion list match glob patterns so
the long-standing `.Trash-*` entry actually excludes anything.
Exclusions are now applied before the directories are stat'ed, and a
directory that raises OSError during Structure B detection is skipped with
a warning instead of propagating. An unreadable folder used to bubble a
500 out of `/api/heartbeat`, which the frontend retried in a loop during
first-time setup.
Fixes#4043
KIOSK_MODE stripped every non-READ grant from all non-admins after group
and override resolution, so a logged-in user with "Saves & States: Write"
still got a 403 from POST /api/states|saves|screenshots. The permission
UI saved grants the server then silently discarded.
The cap now applies only to the synthetic guest KIOSK_MODE hands out
(User.is_kiosk_guest). It has to stay for the guest: with no permission
group of its own it falls back to the server default group ("Viewer
(legacy)" = WRITE_SCOPES), so dropping the cap outright would let
anonymous visitors upload assets and edit collections.
Fixes#4044
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Removing the read-time recompute left the cached membership blind to
everything that is not a ROM edit. A save, a state, a status, or moving
a ROM in or out of a regular collection all change what `has_saves`,
`has_states`, `statuses`, `collection_id` and `favorite` match, so the
stored counts, covers and ROM-detail chips went stale until an unrelated
edit or the next scan.
Refresh from those paths too: save and state upload, delete and
visibility toggle, `update_rom_user` when a status is set, and adding or
removing collection members. Sharing an asset is included because
`has_saves` matches other users' public saves, so it moves collections
that are not the uploader's.
These changes leave the ROM row alone, so they pass `membership_only`
and only recount a collection when the ROM actually joined or left.
Autosaves land constantly, and without it every one of them would force
a full recount of any collection the ROM already belonged to.
Reported by Greptile on #4039.
Implemented with Claude Code (Opus 5), tests first, then reviewed and
verified by me.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Recomputing every smart collection after a delete scanned the library
once per collection, synchronously on the event loop and inside a single
write transaction. Ask instead which of the changed ids each collection
matches: that resolves as a primary-key lookup, so only the collections
actually holding one of them pay for a recount.
Follow the same refresh into `update_rom` and the metadata reset. Both
change exactly the fields the saved filters match on, so cached counts
and cover mosaics no longer wait for the next scan to catch up.
Guard every call site. The ROM write is already committed by the time
the refresh runs, so a failure there must not be reported back as a
failed edit, and must not cost a bulk delete its per-ROM report.
Drop the handler-level test for leaving a collection untouched on read;
the endpoint test covers that invariant through the route the bug was
reported against.
Follow-up review of f4ac78c46 (#4029). Implemented with Claude Code
(Opus 5), then reviewed and verified by me.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A smart collection re-ran its filters across the whole library on every
request, loaded every match into memory with its joined metadata, wrote
the membership back, and only then asked for the page being displayed.
The cost tracked library size rather than collection size, was paid twice
on first load and again on every scroll, and the write bumped updated_at,
which the covers embed as a ?ts= cache-buster.
Translate the stored filter_criteria into filter_roms keyword arguments
and apply them to a bare Rom.id select instead, so membership stays in
SQL and the database returns just the rows being rendered. The criteria
vocabulary is filter_roms' own, so this composes with the gallery's
filters. smart_collection_id is dropped from the criteria: the v2 create
dialog records the route it was opened from, so a collection built while
viewing another one carries its id, which would nest and could cycle.
Bind parameters for the MATCH clauses are now named after the term they
carry. A statement can hold two of them (the collection's search term and
the gallery's), and SQLAlchemy does not uniquify explicitly named text()
parameters, so a fixed name let one term overwrite the other.
The cached rom_ids / rom_count / path_covers_* columns still back the
collections list and the ROM detail page, so refresh them on write --
smart collection create and update, after a scan, and after ROMs are
deleted -- rather than as a side effect of browsing. They are computed
for the owner: the row is shared, so a per-user criterion like favorite
would otherwise describe whoever opened the collection last.
Regular collections and the favorites filter get the smaller half of the
same treatment: an indexed subquery over collections_roms instead of an
IN list built in Python. An unknown collection or smart collection now
returns nothing rather than falling through to the entire library.
Fixes#4029
AI assistance: implemented with Claude Code (Opus 5), tests first, then
reviewed and verified by me.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The scheduler only started when one of four ENABLE_SCHEDULED_* flags was
true, but nothing else respects that condition. startup.py registers the
netplay, upload-tmp and zip-cache cleanups unconditionally, three more
flags gate periodic tasks that are absent from the list, and the
filesystem watcher defers its rescans through the scheduler as well.
Any of those leaves jobs sitting in the scheduler registry with no
process to run them. On a default install the three cleanups never fire
at all. A watcher running with none of the four listed tasks enabled
leaves a delayed scan_platforms entry that nothing will execute, and the
concurrent scan guard reads it as a scan already queued, so every manual
scan is refused with "A scan is already in progress". Restarting does not
help, because the entry is persisted state rather than a running process.
Start the scheduler unconditionally, matching entrypoint.sh, which never
gated it. A stuck entry then clears on its own, since the scheduler
enqueues past-due jobs as soon as it comes up.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The search box offered "name, filename, hash", but the term only ever
reached roms.name and roms.fs_name. A term that is hex of exactly a
digest length now also matches the hash columns on roms and rom_files,
the latter being what makes multi-disc games findable by a file's hash.
The two sides are unioned rather than OR'd. No engine merges a full-text
index with a B-tree index, so OR-ing them costs the name side its index
and scans roms end to end (3.306s against 0.005s on 300k rows). Neither
table had an index on any hash column, so 0106 adds them.
Fixes#4008
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Keep the save prop as the write-back target for "Save & Quit" without
adding a second prop to say which asset boots: when both a save and a
state are selected, the session resumes from the state.
The save is no longer loaded right before a state overwrites it, so the
outcome is the same but without the discarded SRAM injection.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The scan language priority defaulted to ["en", "fr"], and get_preferred_languages
appended ["en", "fr"] unconditionally on top of whatever was configured. French
was therefore impossible to remove, and a user asking for a single language still
got French descriptions.
That fallback originally existed only for ScreenScraper's `familles` and `modes`
taxonomies, which are French-authored and frequently untranslated. It was lifted
into a general language preference when the setting was introduced, at which point
it started applying to the synopsis as well.
Split the two concerns: get_preferred_languages now honors the configured order
verbatim (falling back to English only when the list is empty) and drives the
synopsis, while the new get_taxonomy_languages appends the en/fr fallbacks for
franchises and game modes. The config default drops to ["en"].
Configuring ["de"] now yields a German description or none, rather than a silently
French one, while French franchise and mode names are still used where no English
entry exists.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The v2 player armed a save and a state independently and handed both to
<Player>, which applied the save and then the state. A savestate restores
the whole machine (SRAM included), so the save was always discarded when
any compatible state existed.
Split the two roles the `save` prop was serving: it stays the write-back
target for "Save & Quit", while a new `resumeFrom` prop says which asset
actually boots. The v2 shell passes the visible tab, so the AssetPreview
("Resume from save/state") and what loads can no longer disagree.
v1 keeps save and state mutually exclusive, so it leaves `resumeFrom`
unset and falls back to the previous precedence.
Fixes#4010
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The gamelist branch of generated_first_release_date is gated on an
8-digits/T/6-digits regex, which does not prove the digits form a real
date. EmulationStation, ES-DE and Skyscraper write "00000000T000000" for
an unknown release date, and make_timestamp raises on it. Because the
column is STORED, that aborts the 0098 ALTER TABLE on upgrade, and any
later INSERT of such a ROM on installs already past 0098.
romm_gamelist_epoch_ms now traps the error and returns NULL, matching the
range guard the MariaDB branch already applied. 0105 replaces the
function in place for installs that have already run 0098.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Genre / company / franchise / collection chips were plain spans with a
hover affordance but no behavior, dropping the pivot-to-search v1 offered
from the same rows. Sections now carry the gallery filter their items map
to, and the chips render as links into the search view scoped to that
value. Links rather than click handlers, so middle-click and open-in-new-
tab work and the chips join keyboard / spatial navigation.
Fixes#4011
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Opening Search (navbar button or the "/" hotkey) left focus nowhere, so
typing right away did nothing. The toolbar's search field now takes focus
on mount, gated to precise-pointer, non-gamepad devices: touch would pop
the on-screen keyboard uninvited, and a focused text field swallows the
gamepad's synthetic arrow keys.
`shouldAutofocusSearch` moves out of RSelect into v2/utils, since it is
now shared policy rather than an RSelect internal.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
FPKGi writes downloads to `[<title_id>] <name>.pkg`. Packages of a rom
share a title id, so the category label alone (`<Game> - DLC`) collided
for every rom holding more than one package of a category, and each
download overwrote the previous one on the console.
Each package now takes the first of its candidate names that no other
package in the rom claims: the category label, then the file name, then
both, falling back to the rom file id.
Fixes#4020
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>