Commit Graph

83 Commits

Author SHA1 Message Date
Spinnich
5fb27a55f9 feat(screenscraper): make scanning aware of the account's reported limits
ScreenScraper returns the account's allowances on every response, but only
maxthreads was read. Use the rest:

- Pace requests against the reported maxrequestspermin (falling back to the
  documented threads x 50), so fast lookups can no longer overrun the
  per-minute budget without ever exceeding the thread cap.
- Report the remaining daily and unrecognized-ROM quotas after each platform
  and at the end of a scan, and warn once when either drops below 10%.
- Hint once per scan when SCAN_WORKERS is below the thread allowance (scans
  slower than the account allows) or above it (extra workers just queue).
- Raise a distinct error when a request is refused twice for exceeding the
  rate, so the ROM is reported as skipped in the scan summary instead of being
  saved with no ScreenScraper data.
- Route ScreenScraper media downloads (covers, screenshots, manuals, mixed
  media) through the same limiters, since they are api2 endpoints that count
  against the same allowances, and derive their timeout from the account's
  advertised download speed.

Fixes #3978

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 17:09:52 +00:00
Georges-Antoine Assi
96833892ce security: enforce asset upload limits before spooling, cover screenshots
Addresses the Greptile review on #3952.

- Reject oversized asset uploads from Content-Length in middleware, before
  FastAPI parses and spools the multipart body to temporary storage. The
  handler-level check stays as a backstop for chunked requests.
- Apply the limit to screenshot fields on the save, state and standalone
  screenshot endpoints, not just the primary file.
- Clamp the autocleanup limit to at least 1 so a non-positive value cannot
  wipe every save in a slot.
- Document the new settings in env.template.

Rename MAX_SAVE_UPLOAD_SIZE_BYTES to MAX_ASSET_UPLOAD_SIZE_BYTES now that it
covers states and screenshots too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 09:24:42 -04:00
Georges-Antoine Assi
dfc4f6a6f5 fix(archives): end bsdtar options before the member argument
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 07:48:05 -04:00
Georges-Antoine Assi
969d9b3f9e fix(archives): fail archive hashing when a member can't be read
A member that failed or timed out mid-archive ended the member stream
silently, so the caller kept the composite hash built from the members
that happened to succeed. Raise ArchiveReadError instead and fall back to
hashing the archive's raw bytes, with no archive_members recorded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 07:37:39 -04:00
Georges-Antoine Assi
dc981f51c8 fix(archives): read RAR archives through bsdtar so they can be hashed
The bundled 7zz is built without the RAR codec (unRAR license), so it can
neither list nor extract RAR members. Every content-based match silently
came up empty for .rar: no RetroAchievements hash and no CRC/MD5/SHA-1 for
hash-database providers.

RAR listing and extraction now go through libarchive's bsdtar, added to the
images as libarchive-tools. Listing uses an mtree rewrite (libarchive's only
machine-readable listing) and member names are escaped before being handed
back to bsdtar, which matches them as globs.

Fixes #3884

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 10:13:50 -04:00
Georges-Antoine Assi
de63580fcf trunk fmt everything 2026-07-19 20:35:51 -04:00
Georges-Antoine Assi
9488ceba0e Merge pull request #3167 from tmgast/fix/mod-zip-range-requests
feat: Support Range requests for multi-file ROM downloads
2026-07-19 18:32:12 -04:00
Georges-Antoine Assi
8fc0202e79 fix test 2026-07-19 15:16:38 -04:00
Georges-Antoine Assi
703683a717 fix(playmatch): allow self-hosted origins past SSRF protection
A self-hosted PLAYMATCH_API_URL on a LAN IP, localhost, or a Docker
service name is rejected by the shared HTTP client's SSRF defense before
connecting, so health checks and lookups fail. Add a narrowly scoped
allowlist, derived from the admin-configured provider URL, that both SSRF
gates (the static URL hook and the connect-time backend) honor. The
exception is matched by exact host and port, and the public default URL
is unaffected since public addresses already pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:33:28 -04:00
Georges-Antoine Assi
cf1420bd5d Merge branch 'master' into fix/mod-zip-range-requests 2026-07-18 18:15:39 -04:00
Spinnich
e6c1ca8487 fix(archives): address extraction review findings from PR #3813
Disable 7zz wildcard matching (-spd) when extracting a named member: a
member literally named with "*" or "?" would otherwise act as a pattern,
matching other members and concatenating them into the -so stream, which
would hash plausible-but-wrong data. Applied to all three extraction
call sites, including the two pre-existing readers that share the
hazard. Verified against the production Alpine 7zz build.

Route extraction stderr to an unlinked temp file instead of a pipe: a
filled pipe blocks 7zz while the parent waits on stdout.read(), which
the chunk-based deadline never interrupts. A file-backed stderr applies
no backpressure and is still read back for the error log on failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 20:34:44 +00:00
Spinnich
b7c60e63a3 fix(retroachievements): extract non-zip archives before RAHasher hashing
RAHasher only decompresses .zip archives itself; any other container
(.7z, .rar, .gz, .bz2, .xz, .tar, ...) was hashed as its raw archive
bytes, silently storing a well-formed hash that matches nothing on
RetroAchievements (issue #3808).

Non-zip archives on buffer-hash platforms are now extracted to a temp
file via the bundled 7zz binary and the extracted ROM is hashed instead.
The new extract_largest_archive_member helper follows the existing 7zz
subprocess patterns, handles single-stream formats whose listings carry
no Attributes line (.gz/.xz), and unwraps one level of nesting so
compressed tarballs (.tgz) reach the ROM inside the inner tar.

Arcade is exempt: its RA hash is computed from the file's basename, so
any container format already hashes correctly and extraction (which
renames the file) would break it. Disc platforms keep their existing
archive skip.

When extraction fails (corrupt archive, or a codec the 7zz build lacks,
e.g. RAR) no hash is stored at all and the 7zz stderr reason is logged
at error level, so scan logs explain the missing hash instead of
silently storing a garbage one.

Fixes #3808

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 20:06:12 +00:00
Georges-Antoine Assi
fe32918b46 refactor: simplify ZIP cache range-request support
- Centralize the cache-hit-or-build-then-fallback flow into
  resolve_cached_zip(), collapsing three near-identical endpoint
  blocks; add ZipFileEntry.from_rom_file() factory.
- Use get_ttl_hours() (now size-based) in cleanup_stale_zips instead
  of inlining the tier decision.
- Drop on-demand LRU eviction and the 2x space guard; a full disk now
  falls back to mod_zip streaming via the existing build try/except.
- Replace the per-request importlib.reload(zipfile) with a one-time,
  thread-safe shim that fixes zipfile_inflate64's _get_compressor
  signature without a global module reload.
- Simplify get_cache_key by folding the empty-entries case into the
  normal path (non-empty keys unchanged).

Generated-By: PostHog Code
Task-Id: e68b880f-34d8-4bf6-8cd0-886ef2caecb4
2026-07-16 21:55:28 -04:00
TowyTowy
f225a99f89 fix(platforms): include TGDB handler in tgdb_id fallback for supported platforms
get_supported_platforms() resolved tgdb_id from the MobyGames and
Hasheous platform entries only, but MobyGames platforms never carry a
tgdb_id and the Hasheous platform list has no TGDB mappings, so the
explicit key always overrode the value spread from the TGDB handler
with None. Mirror the fallback chain used during scans in
scan_handler.py by falling back to the TGDB platform entry itself.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-17 01:04:45 +02:00
VoidHandler
efa5945f03 fix(backend): validate embedded cover format and surface extraction failures
Restrict extracted audio cover bytes to JPEG/PNG via magic-byte sniffing
instead of trusting the declared MP4 imageformat, so a GIF (or missing
format) is no longer mislabeled and persisted as image/jpeg.
2026-07-08 00:33:43 -04:00
VoidHandler
d169e5f4e4 fix(backend): correct M4A embedded cover MIME detection
MP4Cover.FORMAT_PNG was referenced via a non-existent MP4.Cover attribute,
breaking cover extraction for m4a files. Add unit tests and guard
extract_embedded_cover so failures do not abort the upload path.
2026-07-07 22:19:00 -04:00
Georges-Antoine Assi
e61d6cd5b8 fix(platforms): stop platform variants from renaming the parent platform
get_supported_platforms built a slug->platform map with a plain dict
comprehension. When a folder is mapped as a variant or alias of an
existing platform, scanning resolves it to the parent slug, so two
platform rows share the same slug. The comprehension let the later row
(the variant) overwrite the parent, renaming it in the platform picker
and Folder Mappings page.

Prefer the canonical platform (fs_slug == slug) when building the map so
a variant folder no longer shadows its parent.

Fixes #3157

Generated-By: PostHog Code
Task-Id: 571866ea-86a0-49c2-b62e-dbea077d0181
2026-07-06 10:17:34 -04:00
Georges-Antoine Assi
8a43ae3009 fix: allow NAT64-wrapped public IPs through SSRF filter
DNS64/NAT64 networks synthesize IPv6 answers that embed a public IPv4
in the RFC 6052 well-known prefix 64:ff9b::/96. The SSRF classifier
rejected these because the prefix is is_reserved, breaking all outbound
metadata and cover fetching on NAT64-only deployments.

is_forbidden_ip now unwraps a NAT64-wrapped address and evaluates the
embedded IPv4 instead, so a wrapped public IPv4 is allowed while a
wrapped private/internal IPv4 (e.g. 127.0.0.1, 10.0.0.1) stays blocked.

Fixes #3668

Generated-By: PostHog Code
Task-Id: 73b38615-966e-4955-9228-2cb6bbcda277
2026-07-04 22:16:09 -04:00
Georges-Antoine Assi
c49e144311 Merge pull request #3640 from tmgast/feature/soundtrack-metadata-columns
Add a music query API for soundtracks
2026-07-04 12:18:32 -04:00
Spinnich
567f6fb84f chore(retroachievements): trim comments and redundant RVZ tests
Condense the rvz_hasher module docstring and hardening comments, and
drop three tests whose coverage was already provided elsewhere (the
container-compression transitivity check and the Wii duplicates of the
container-level magic/missing-file failure tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:27:17 +00:00
Spinnich
e5b196b8c3 fix(retroachievements): harden RVZ hashing against malformed containers
- Catch zstandard.ZstdError so a corrupt zstd group returns no hash and
  falls back to RAHasher instead of aborting the scan.
- Cap chunk_size at 64 MiB and tighten the group-count bound so crafted
  headers can't force multi-GB allocations.
- Bound decompression output per group (bz2/lzma max_length, chunked
  zstd stream reads) to defuse decompression bombs.
- Reject main.dol segments extending past the disc end; a corrupt size
  field would otherwise stall the scan hashing zero-fill.
- Key the group cache on all decode parameters and size it to keep one
  Wii hash group's chunks cached across the data and exception passes
  (avoids double decompression with sub-128 KiB chunks).

Real-ROM hashes are unchanged (both still match RA's database).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:10:58 +00: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
Spinnich
174fad915e fix(retroachievements): hash GameCube and Wii RVZ/WIA images natively
RAHasher can't read the block-compressed RVZ/WIA containers Dolphin
creates, so GameCube and Wii games stored as .rvz/.wia never matched on
RetroAchievements ("Not a Gamecube disc" / "Not a supported Wii file").

Add utils/rvz_hasher.py, which reconstructs only the disc byte ranges
the RA hash covers, mirroring rcheevos:

- An RVZ/WIA reader with random access over raw-data and partition
  groups (NONE/bzip2/LZMA/LZMA2/Zstandard codecs, RVZ packing with the
  lagged-Fibonacci junk PRNG, and stored hash exceptions).
- GameCube: MD5 of the boot header, apploader and main.dol segments.
- Wii: the hash additionally covers encrypted cluster bytes, so the
  reader recalculates the H0/H1/H2 hash tree, applies the container's
  hash exceptions and re-encrypts clusters with the embedded title key
  (AES-128-CBC) to reproduce the exact retail disc bytes.

RAHasherService tries the native path for .rvz/.wia on the GameCube and
Wii platforms and falls back to RAHasher on any failure.

Verified against Mario Kart: Double Dash!! (USA) and Super Mario Galaxy
(USA) RVZ dumps: the computed hashes are present in the official RA
hash lists (games 7693 and 189), and RAHasher 1.8.3 produces identical
hashes when run on disc images reconstructed by the same reader.

Closes #3649
Closes #3650

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 21:58:10 +00: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
Claude
4f9117d9f8 fix(ra): hash PSP compressed-ISO containers natively (#3600)
PSP games stored as .cso (and .ciso/.zso/.dax) never matched on
RetroAchievements because RomM hands these files to the external RAHasher
binary, which can't read CSO/ZISO/DAX compressed-ISO containers and fails
with "Could not open track". The game was then left without an RA link.

The PSP RA hash does not depend on the whole disc: rcheevos computes it as
MD5(PSP_GAME/PARAM.SFO + PSP_GAME/SYSDIR/EBOOT.BIN), each file capped at
64 MiB. Those containers are block-indexed, so we can decompress just the
blocks those two files occupy and hash them in-process, producing the
identical hash RA stores (and PPSSPP computes).

Add utils/psp_hasher.py: a seekable block-decoder for CISO/ZISO (deflate
and LZ4) and DAX containers, a minimal ISO9660 reader to locate the two
files, and calculate_psp_ra_hash(). RAHasherService now computes the hash
natively for PSP .cso/.ciso/.zso/.dax files, falling back to RAHasher on
any failure. Raw .iso PSP discs still go to RAHasher, which reads them fine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsyrT6n8WYWWxR2XGoEASs
2026-06-25 22:58:56 +00:00
zurdi
8d75474890 Merge remote-tracking branch 'origin/master' into chore/permissions-system-rework 2026-06-25 13:44:38 +00:00
zurdi
649ddce2aa feat: Implement fine-grained permission checks and admin CRUD for permission groups
- Added new permission handling in `backend/handler/auth/dependencies.py` to support fine-grained, DB-backed permission checks.
- Enhanced user role update logic in `backend/endpoints/user.py` to prevent demotion of the last admin.
- Introduced `hidden_platform_ids` and `hidden_rom_ids` parameters in various database handlers to manage visibility based on admin settings.
- Created new endpoints for managing permission groups, user memberships, and hidden entities in `backend/tests/endpoints/test_permissions_admin.py`.
- Added tests for permissions visibility and CRUD operations in `backend/tests/endpoints/test_permissions_visibility.py` and `backend/tests/endpoints/test_permissions_me.py`.
- Updated archive handling in `backend/utils/archives.py` to improve error logging and timeout management during extraction.
2026-06-24 08:45:45 +00:00
Ian Mancini
8e97a7f064 fix: add shortname dictionary for pegasus export 2026-06-21 16:17:56 -03:00
Georges-Antoine Assi
e657948bba fix trunk 2026-06-18 21:17:47 -04:00
Georges-Antoine Assi
13007b36df cleanup tests 2026-06-18 21:12:13 -04:00
Georges-Antoine Assi
1e78a2ed59 Merge branch 'master' into claude/exciting-heisenberg-61PF9 2026-06-18 19:59:00 -04:00
Claude
cd41422660 Use a concurrency limiter for ScreenScraper, honoring account threads
ScreenScraper enforces a per-account *thread* (concurrency) cap rather than
a request rate. Requests can take several seconds, so spacing out request
starts at 1/s could still leave multiple requests overlapping in flight,
exceeding the cap and getting rejected with ScreenScraper's custom HTTP codes.

- Add ConcurrencyLimiter: a runtime-resizable, loop-agnostic limiter that
  bounds simultaneous in-flight operations (held for the whole request via
  async context manager), instead of spacing request starts.
- Switch the ScreenScraper service from the req/s RateLimiter to a module-level
  ConcurrencyLimiter defaulting to a single thread.
- Recognize contributor/donor accounts: parse `ssuser.maxthreads` from each
  response and raise the concurrency allowance to match, so supporters scrape
  with their full thread count instead of the conservative default.

Adds unit tests for the limiter (blocking, wake-on-release, runtime resize)
and for the ScreenScraper slot-holding and thread-allowance updates.

https://claude.ai/code/session_01133QQuWvq8Zm25DZMP9PVr
2026-06-06 16:02:13 +00:00
DevYukine
8006e4391d feat(playmatch): pre-emptive 4 req/s rate limiting with best-effort lookups 2026-06-06 04:16:21 +02:00
Georges-Antoine Assi
7509707fe7 fix test 2026-05-27 21:50:56 -04:00
Georges-Antoine Assi
5f63668996 cleanup 2026-05-27 20:58:33 -04:00
Georges-Antoine Assi
c3adbd3f71 fix(ssrf): bound DNS lookup by caller timeout; clear lint findings
The async backend's `loop.getaddrinfo` ran without any timeout, so a
slow or hanging resolver could outlive the timeout the caller passed —
the previous code only bounded the TCP connect inside the inner
backend. Wrap the resolution in `asyncio.timeout(timeout)` and surface
the timeout as `httpcore.ConnectTimeout`.

Also tidy the test stubs (mypy func-returns-value) and add explicit
type annotations to the `calls` lists (mypy var-annotated). A targeted
`# noqa: ASYNC109` sits on the `timeout` parameter of `connect_tcp` /
`connect_unix_socket` with an explanatory comment: the rule advises
against `timeout` parameters on async APIs we author, but here we're
implementing `AsyncNetworkBackend`, and the timeout is consumed in the
asyncio-native pattern the rule endorses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 18:31:42 -04:00
Georges-Antoine Assi
30451d5651 fix(security): move SSRF defense into the HTTP client path
The previous validator did a preflight `socket.getaddrinfo` before each
httpx request. Two problems:

  * DNS rebinding / TOCTOU: httpx re-resolves at connect time, so a
    hostname can answer with a public IP for the validator and a
    private IP for the real request. The preflight check did not
    constrain the connection.
  * Event-loop blocking: `socket.getaddrinfo` is synchronous, and the
    media-download callers are async. Slow resolvers stalled
    unrelated requests.

Replace it with two layers, both wired automatically onto every httpx
client built by `utils.context`:

  1. A request event hook running `validate_url_for_http_request`
     (syntactic checks only: scheme, reserved hostnames, literal IPs,
     internal TLDs). No DNS, no call-site responsibility.
  2. `SSRFProtectedAsyncBackend` / `SSRFProtectedSyncBackend`, custom
     httpcore network backends that resolve the hostname inside
     `connect_tcp`, reject any address in a forbidden range, then
     connect to that *same* validated address. The async variant uses
     `loop.getaddrinfo` so it doesn't block the loop. httpcore calls
     `start_tls(server_hostname=<URL host>)` after `connect_tcp`, so
     TLS SNI and cert verification still use the original hostname
     even though the TCP layer connects by IP.

Drop the explicit `validate_url_for_http_request(...)` calls from
`resources_handler.py` — the event hook covers them. Consolidate the
URL validator and its tests under `utils/ssrf.py` /
`tests/utils/test_ssrf.py` so the SSRF surface lives in one module.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 17:58:14 -04:00
Georges-Antoine Assi
3ae7f998b9 run fmt 2026-05-27 09:20:23 -04:00
Claude
009d358175 fix(security): resolve hostnames in SSRF URL validator
validate_url_for_http_request previously skipped DNS resolution, so
attacker-controlled domains that resolve to private/loopback/link-local
addresses (e.g. 127.0.0.1.nip.io) passed validation and the subsequent
httpx GET hit internal services. Resolve the hostname via getaddrinfo
and reject any result whose IP is private, loopback, link-local,
reserved, multicast, or unspecified. Unresolvable hostnames are
rejected as well.

https://claude.ai/code/session_01T335ZvA825YhuzPctmYzUy
2026-05-27 12:33:36 +00:00
Claude
4f3d75ae30 test: add property-based tests for SSRF URL validation and CHD hashing
Extend Hypothesis coverage to the security-critical URL validator
(globally-routable IPs allowed; private/loopback/link-local/multicast and
internal TLDs always blocked; non-http schemes rejected; never leaks
non-ValidationError exceptions) and to CHD v5 header SHA1 extraction
(valid headers, version/signature/truncation rejection, robustness on
arbitrary bytes). Adds light property coverage for username/email validators.

https://claude.ai/code/session_01GCTFmzuhvqNbSAfw3rGxmj
2026-05-21 17:48:33 +00:00
Claude
95958b6687 test: integrate Hypothesis property-based testing for backend
Add Hypothesis to the test dependency group with CI/dev profiles, and
introduce property-based tests for high-value pure functions: crc32_to_hex,
filesystem and LaunchBox filename sanitization, LaunchBox metadata parsers,
and ROM filename tag parsing.

https://claude.ai/code/session_01GCTFmzuhvqNbSAfw3rGxmj
2026-05-21 16:40:04 +00:00
Georges-Antoine Assi
584f35b797 changes from bot review 2026-05-19 07:52:43 -04:00
Georges-Antoine Assi
adb050f164 commit and push 2026-05-19 07:31:25 -04:00
Georges-Antoine Assi
757fafae5f feat(fs): hardlink import/export assets when possible, harden sync init
Importer (gamelist/launchbox file:// flows) and exporters (gamelist.xml,
metadata.pegasus.txt local exports) now hardlink media assets when source
and destination share a filesystem, falling back transparently to a copy
on EXDEV / EPERM / EOPNOTSUPP / EMLINK / EACCES (cross-device, FAT32,
exFAT, network mounts, etc.). Saves disk space and is effectively
instantaneous on large files (videos, manuals, miximages).

Covers keep a real copy (allow_link=False) because _store_cover resizes
the small cover in place via PIL.Image.save, which would truncate the
shared inode and corrupt the user's source image.

Also makes FSSyncHandler tolerate a missing/unwritable /romm/sync at
startup: an OSError from mkdir now logs a warning instead of crashing
the whole app at module-import time. Sync calls still fail at use time
if the mount remains broken — the right place to surface the error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 07:38:11 -04:00
Georges-Antoine Assi
e92dbf060d run fmt 2026-05-16 08:58:20 -04:00
Georges-Antoine Assi
6f6d4c70ab Add integration tests for export_platform_to_file asset copying
Cover the local-export flow end to end: redirect resource and library
base paths into a tmp_path sandbox, run export_platform_to_file, and
assert that media files land at <platform>/assets/<subdir>/<rom>.<ext>
and that gamelist.xml references them. A second test withholds source
files to verify that failed copies omit their tags from the XML while
other assets still export.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 08:54:04 -04:00
Georges-Antoine Assi
4f03cdf03d Copy gamelist media into a local assets/ folder
Mirror the pegasus exporter pattern: collect each ROM's media into a
canonical asset-kind dict, then either copy the files under
<platform>/assets/<subdir>/ for local exports or build absolute URLs
from request.base_url for remote exports. Exclude the generated assets/
directory from filesystem scans.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 08:15:41 -04:00
Georges-Antoine Assi
f4227cafaf Build absolute resource URLs and simplify traversal check
Use URLPath.make_absolute_url with request.base_url to build resource
URLs for non-local exports, and simplify the local-export traversal
check with Path.is_relative_to.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 22:22:09 -04:00
Gavin Tronset
4a2a4d6d38 PR feedback for tests and relpath validation 2026-05-13 15:23:54 -07:00
Gavin Tronset
b7a1dad960 Remove now-uneeded test and change import 2026-05-13 13:37:45 -07:00