Commit Graph

17 Commits

Author SHA1 Message Date
Zach Clendenen
0742f133e0 fix(api): apply code-review fixes for overlong names
pr-ready step 2 (code-review xhigh --fix): byte-check screenshot, rename
and ROM fs_name paths, fit streaming save archive names, cap email and
collection names, log duplicate collections at warning.
2026-10-01 10:34:16 -05:00
Zach Clendenen
438347615a fix(api): return 4xx for duplicate collections and overlong names
A duplicate collection name raised a 500. Names compare
case-insensitively in the database, so "TRUE" collides with "True".
Return 409 instead, as the existing test's name already said.

Memory card name and emulator, and the RetroAchievements username,
had no length check before the insert, so an overlong value failed in
the database with a 500. Validate them against their column lengths,
which returns 422.
2026-09-30 22:30:43 -05:00
Sam Dornan
6941de13db Remove unused code and deduplicate copied helpers (#4975) 2026-09-30 18:51:36 -04:00
nendo
f0c49b6a38 feat(devices): push downloads from the web UI to a device's download queue 2026-09-28 02:08:03 +09:00
Sam Dornan
3750d6ff70 chore(mypy): require full annotations outside tests, type the setup responses (#4795) 2026-09-26 15:31:00 -04:00
nendo
70e583b9a0 Add music favorites and playlists API
Spotify-style library features for soundtrack tracks: per-user favorites
(liked songs) and user-owned playlists with manual ordering and optional
public read-only sharing.

Track references are stored as (rom_id, md5_hash) rather than rom_file_id:
scans purge and re-insert rom_files rows, so file ids churn while rom ids
and content hashes are stable. Entries survive rescans and renames, and
resolve to the current file at query time; entries whose content is gone
are omitted from listings until the file returns.

To make the content hash reliably present, soundtrack audio files are now
always hashed individually during scans (including NON_HASHABLE_PLATFORMS
and SKIP_HASH_CALCULATION, whose file-size concerns don't apply to audio),
and soundtrack uploads compute crc/md5/sha1 on write. Existing libraries
backfill via a HASHES scan; adding an unhashed track returns 400.

New playlists.read/playlists.write scopes are wired through the granular
permission system (PermEntity.PLAYLISTS); the migration mirrors every
group's collections grants onto the playlists entity so existing groups
keep working without admin intervention.

Endpoints under /api/music: favorites GET/POST/DELETE, is_favorite and
md5_hash on track rows, playlists CRUD, playlist tracks GET/POST/DELETE
and PUT /tracks/order.
2026-07-23 15:32:32 +09:00
Michael Manganiello
e4e3928d1b misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Michael Manganiello
9ba787f6d1 fix: Remove critical log messages for 403 and 404 exceptions
These critical log messages are unnecessary and can clutter the logs,
based on user requests. This is even more notorious when RomM is
integrated to an error tracking system like Sentry.
2025-06-06 21:40:31 -03:00
zurdi
30a0be2c4c Merge branch 'master' into HEAD 2025-04-10 22:56:55 +00:00
zurdi
2a5bf1ab5b Add SGDBInvalidAPIKeyException for handling invalid API key errors 2025-04-01 09:52:33 +00:00
SaraVieira
9b298d46eb use env & reuse request 2024-09-10 21:00:20 +01:00
SaraVieira
2d39949aa0 show info on frontend 2024-09-08 16:35:30 +01:00
Zurdi
23e0a064ab added update collection endpoint 2024-07-02 23:34:50 +02:00
Zurdi
857573e607 Merge remote-tracking branch 'origin/master' into feature/collections 2024-07-02 17:53:35 +02:00
Zurdi
4a413db4c5 fixes from PR review 2024-07-02 17:49:48 +02:00
Zurdi
cc9e05f668 collections migration added 2024-07-01 23:47:15 +02:00
zurdi
15f7522da5 rom db hanlder refactor to adapt to user_rom_props 2024-07-01 15:30:14 +02:00