Rename cached_md5s to cached_hashes, since it also caches PSP member
hash maps, and keep its docstring to one line.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Key PSP member hashes on the bundle's content hash, computed once in a
thread, cached via the shared batch helper, and guarded only on write
- Build only the requested tree for a PROPFIND listing
- Walk blobs with iter_files, share the bundle limit check and reader
- Drop the derivable ManifestAsset.parent_path and the closure factories
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Read every asset and blob hash from one MGET, compute misses with
bounded concurrency and write them back in one pipeline.
- Split the manifest into a path builder and a hashing layer; PROPFIND
of saves/ and states/ now lists paths without hashing assets, walking
blobs or inflating PSP bundles (member names come from the zip
central directory).
- Walk blob directories once off the event loop with os.scandir, reusing
each entry's size and mtime for the hash cache key.
- Build PSP bundles off the event loop and prime the member-hash cache
on write so the next manifest skips inflating them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
RetroArch names a slot's state the same under every core, and its
screenshot was filed per ROM, so two cores' `<rom>.state.png` shared
one file and one row. File them under a per-core screenshots folder,
upsert by path, and only match a state to a screenshot in its own core's
folder or the ROM-level one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Enforce the upload size cap on streamed bytes in the middleware, so
chunked uploads to every guarded route are bounded, not just RetroArch
- Flag vanished assets missing_from_fs from the manifest instead of
re-hashing them every sync
- Batch state screenshot lookups, filter PSP bundles in SQL, hash files
in one thread hop, and read only the requested PSP bundle members
- Reuse remove_screenshot and content_hash_of_bytes, merge the save and
state PUT branches, drop dead checks and trim docstrings and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Stream RetroArch PUT bodies with a byte cap, so a chunked upload
can't bypass the Content-Length check and exhaust memory
- Map shared core folders back to the mednafen_* ids the web player uses
- Enforce PSP bundle limits on write, return 409 for invalid bundles,
and never delete an unreadable bundle when removing one member
- Challenge the kiosk guest so RetroArch sends credentials
- Move a slot-matched state's row with its bytes, scan saves under the
name actually written
- Reject NUL path segments and core folder names over the emulator
column length
- Cache PSP bundle member hashes in the manifest
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
FSRetroArchSyncBlobHandler becomes FSRetroArchSyncHandler, and
SYNC_RETROARCH_BLOB_BASE_PATH becomes SYNC_RETROARCH_BASE_PATH, stored
under /romm/retroarch_sync.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The manifest protocol is RetroArch's own, so name it after RetroArch
rather than its WebDAV transport, and group it with the existing sync
code: endpoints/sync/ becomes a package with the RetroArch router as a
subroute, and the handlers move under handler/sync/retroarch/. Settings
move into the SYNC config section as SYNC_RETROARCH_*.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>