Commit Graph

69 Commits

Author SHA1 Message Date
Georges-Antoine Assi
a93799720e Skip missing packages and reuse real title ids in the FPKGi feed
Files marked missing_from_fs were still advertised, so FPKGi listed a
package whose download URL no longer resolves.

Title ids now come from a CUSA/PPSA id in the rom or package file names
when present, falling back to the generated RomM id. It is resolved once
per rom so a base game and its updates/DLC stay grouped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 08:20:49 -04:00
Georges-Antoine Assi
f896c2cc8c List each PKG file as its own FPKGi entry
FPKGi installs one package per entry, but the feed served a single entry
per rom pointing at the rom download URL, which zips multi-file roms.

Each .pkg file now gets its own entry with its own size and download URL,
named after its category (or file name) when a rom holds several packages.
Adds an optional content_type filter so FPKGi's per-category content URLs
can each point at RomM.

Fixes #3962

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 07:58:52 -04:00
zurdi
4e686e1d74 fix(permissions): address PR review (Copilot + adversarial) findings
Resolves the CI blocker and a cluster of opt-out visibility "fail-open"
gaps surfaced in review of the granular permission system.

Security / correctness:
- admin oauth_scopes projection keeps canonical FULL_SCOPES order
  (order_scopes) instead of sorting alphabetically, fixing the red
  test_user.py::test_admin on MariaDB + Postgres.
- default-group hides no longer fail open: the resolver resolves the
  effective (own-or-default) group before the hidden-entity lookup.
- /roms/by-hash and /roms/by-metadata-provider now 404-mask hidden roms.
- USERS-entity grant no longer enables admin creation: add_user and
  invite-link require a real admin to mint admin accounts.

Visibility leaks closed on secondary read paths:
- feeds, sibling roms (list query + single-rom schemas), /stats counts
  and per-platform breakdowns, collection rom_ids/rom_count, search_rom.

Hardening / cleanups:
- firmware/platform PUT 404-mask hidden entities; group rename conflict
  returns 400 not 500; guard against removing the last default group;
  kiosk read-only enforced at the fine layer; add_hidden_entity rejects
  non-cascading entity types.

Frontend:
- permissionGroups.ensureLoaded coalesces concurrent callers on one
  in-flight request; permissions.setGrants resets isAdmin/hidden;
  CreateUserDialog no longer orphans a user when group assignment fails;
  HiddenGamesPicker search rows are native buttons (keyboard/gamepad);
  invite-role labels and group swatch aria-label use i18n; drop dead code
  (originalRole, unused permissionsApi export).

AI assistance: changes authored with Claude Code (Claude Opus), driven by
the Copilot review and a multi-agent adversarial review, then verified
(backend pytest, frontend typecheck/vitest, i18n parity, trunk).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 12:37:58 +00:00
Claude
c4dd922491 perf(roms): make filter_roms file-loading opt-in for the gallery query
filter_roms feeds both the gallery/list endpoint (SimpleRomSchema, no
files) and the feed endpoints (which iterate rom.files / is_top_level).
The cleanup commit's unconditional selectinload(Rom.files) + joinedload
made the gallery/list and filter-value paths pay for files they never
serialize.

Gate the files load behind a new `include_files` flag (default False),
mirroring the existing `include_file_stats` opt-in, and plumb it through
get_roms_scalar. The 9 feed endpoints that actually read rom.files opt
in; the gallery/list, filter-values, identifiers, smart-collection, and
the three feeds that don't touch files (webrcade, fpkgi, kekatsu) skip
the load entirely — keeping the gallery query at zero file cost.

https://claude.ai/code/session_01PSXKmejPRzdxLFMN6P2QQ4
2026-06-02 12:56:02 +00:00
Georges-Antoine Assi
438c03facc refactor(filesystem): extract archive/CHD helpers to utils/archives.py
Pull file/archive readers (zip/tar/gz/bz2/7z), CHD parsing, and the
shared libmagic MIME detector out of roms_handler.py into a new
utils/archives.py. Rename the previously underscore-prefixed
read_zip_archive_files / read_tar_archive_files to match the existing
read_7z_archive_files convention, and consolidate the duplicated
"with lock: detector.from_file()" pattern into a detect_mime_type helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 08:41:45 -04:00
Georges-Antoine Assi
acda4bb6ce move get_rap_data out of loop 2026-02-10 09:59:29 -05:00
Georges-Antoine Assi
dc857d9649 use csv writer to build feed response 2026-02-10 09:44:59 -05:00
Georges-Antoine Assi
7231414c67 use pkgj last_modified 2026-02-10 08:56:30 -05:00
Georges-Antoine Assi
393375be7f tweaks to returned feed data 2026-02-09 23:20:04 -05:00
Georges-Antoine Assi
959c9ac0bf refactor feeds file 2026-02-03 17:09:21 -05:00
Georges-Antoine Assi
4b4a34631d bot created test file 2026-02-03 16:48:58 -05:00
Georges-Antoine Assi
d0a71ae5fe add new endpoints for pkgj 2026-02-03 16:22:39 -05:00
Georges-Antoine Assi
8078941bd1 [ROMM-2856] Use platform slug to fetch feed games 2026-01-03 12:38:26 -05:00
zurdi
ab637203ac Merge branch 'master' into feat/rom-filter-multivalue 2025-12-24 12:39:45 +00:00
Georges-Antoine Assi
562d976a3e [ROMM-2668] Speedup feeds endpoint 2025-12-09 21:11:11 -05:00
zurdi
19fe6518fc Refactor: update get_roms_scalar calls to support multi-value platform IDs 2025-11-28 16:57:07 +00:00
zurdi
c1d43f67f8 Refactor ROM retrieval to support multi-value platform filtering across various handlers and endpoints 2025-11-27 22:52:33 +00:00
Georges-Antoine Assi
a431704d96 run fmt 2025-11-23 10:23:43 -05:00
phramusca
4685e8d871 minor comments 2025-11-23 15:39:00 +01:00
phramusca
3df6c54850 update comment 2025-11-23 15:30:12 +01:00
phramusca
a8dc87e7e8 fix kekatsu tsv format 2025-11-23 15:22:58 +01:00
Georges-Antoine Assi
a98de7d43f add title_id to fpkg feed 2025-11-19 19:45:07 -05:00
Georges-Antoine Assi
6593b6afeb fix release date format for fpkgi 2025-11-17 19:12:58 -05:00
Georges-Antoine Assi
bc8aeb0047 changes from bot review 2025-11-15 15:14:00 -05:00
Georges-Antoine Assi
0083033f53 [ROMM-2650] Add FPKGi support for PS4/PS5 2025-11-15 14:23:38 -05:00
Georges-Antoine Assi
883843f8d0 tab separate kekatsu feed 2025-11-12 23:00:17 -05:00
Georges-Antoine Assi
d9da0dbab7 changes from bot review 2025-11-11 20:53:19 -05:00
Georges-Antoine Assi
c6af55b11a [ROMM-2648] Encode filename of download URLs 2025-11-11 20:45:59 -05:00
Georges-Antoine Assi
df24b97b0d [ROMM-2645] Wrap items in feeds with double quotes 2025-11-11 16:29:02 -05:00
Georges-Antoine Assi
1eabcfb9f4 Add PSP Pkgi support 2025-10-27 20:36:53 -04:00
Georges-Antoine Assi
bfd2f12181 catch keyerror 2025-10-23 21:55:05 -04:00
Georges-Antoine Assi
ddd82ff751 string replace commas 2025-10-23 21:53:42 -04:00
Georges-Antoine Assi
1707103b2e add kekatsu to feed endpoint 2025-10-19 14:41:01 -04:00
Georges-Antoine Assi
0bde546aee use content type string in url 2025-10-19 14:22:52 -04:00
Georges-Antoine Assi
31709495b4 add endpoint for psvita 2025-10-19 12:30:56 -04:00
Georges-Antoine Assi
d5a0f6416c bugfixes 2025-10-19 12:16:30 -04:00
Georges-Antoine Assi
95e109cbd1 output csv 2025-10-19 11:45:41 -04:00
Georges-Antoine Assi
81702a4bbd Add endpoint for ps3 pkgi 2025-10-19 11:16:32 -04:00
Georges-Antoine Assi
df15e328d0 changes from bot review 2025-10-06 09:13:01 -04:00
Georges-Antoine Assi
212ac04681 tweak and format code 2025-10-05 21:46:46 -04:00
Borb
3e775fa34c Fix: sanitize Tinfoil TitleDB via Pydantic v2 and use .model_dump() in endpoint 2025-10-05 20:23:18 +00:00
Georges-Antoine Assi
f7d2b92f1d add env var for custom tinfoil welcome messagr 2025-10-01 11:29:12 -04:00
Georges-Antoine Assi
3c4113f8a8 Merge branch 'master' into flashpoint-metadata-handler 2025-09-11 21:27:48 -04:00
Michael Manganiello
e4e3928d1b misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Georges-Antoine Assi
ef2546ec08 fix base handler filename 2025-08-27 12:40:16 -04:00
Michael Manganiello
252722e3bc misc: Apply pyupgrade changes for Python 3.12 compatibility
Command applied:
```
find ./backend/ -type f -name "*.py" -exec pyupgrade --py312-plus {} \;
```
2025-06-29 12:27:16 -03:00
zurdi
686a33e559 fix: update thumbnail URL in platforms_webrcade_feed function 2025-06-18 15:34:08 +00:00
Georges-Antoine Assi
05a78e03ce new method for getting non-pagniated roms 2025-03-21 10:08:44 -04:00
Georges-Antoine Assi
dfe3004f5d Direct download for rom files 2025-03-18 09:52:00 -04:00
Michael Manganiello
ed0ab3cd4a misc: Use FRONTEND_RESOURCES_PATH setting in missing places 2025-02-18 21:53:09 -03:00