Commit Graph

4696 Commits

Author SHA1 Message Date
Claude
5b494c3bc4 feat: opt-in per-platform subfolder scanning with non-destructive identity
Adds opt-in, per-platform subfolder scanning (closes #2050). When enabled
for a platform, RomM recurses that platform's subfolders and treats each
nested file as its own ROM, instead of collapsing a subfolder into one
multi-file ROM — so libraries organized into Hacks/, Translations/,
Homebrew/, etc. are scanned correctly.

Enable per platform in config.yml (default off, existing setups unaffected):

  scan:
    subfolders:
      nes: true                       # recurse every subfolder
      snes: ["Hacks", "Translations"] # recurse only these; keep others whole

Key difference from a naive path-identity approach: identity is reconciled
by content hash on scan. Moving or renaming a ROM between subfolders is
detected by its hash against a now-missing ROM and relocated in place, so
saves, play history, favorites and collection membership follow it. Falls
back to path identity when hashing is unavailable (skip_hash_calculation or
a non-hashable platform). A cheap size pre-filter avoids hashing every
newly-seen file (e.g. on first enable).

Details:
- Per-platform opt-in via scan.subfolders (fs_slug -> bool | list[str]); no
  DB schema change.
- Recursion skips hidden (dot-prefixed) folders, and keeps a folder whole as
  a single multi-file ROM when it holds a disc/playlist descriptor
  (.m3u/.cue/.gdi/.ccd/.toc) — covers cue+bin / multi-disc games.
- Path-based keying for the steady-state lookup (get_roms_by_fs_name and
  mark_missing_roms key on full path) so identically-named files in different
  subfolders stay distinct; the (platform_id, fs_name) index is non-unique.
- File resolution (download/delete/hash) uses the ROM's stored fs_path.
- Scan log flags entries that became "missing" because a folder is now
  recursed, so stale entries are easy to clean up.
- Frontend: the Files tab shows a ROM's on-disk Location (click-to-copy),
  built as a shared LocationChip mirroring HashChip's RTag-based pattern.
  New i18n keys added to all locales.

Tests: backend unit tests for recursion (collisions, hidden folders,
descriptor dirs kept whole, named-list form), full-path keying in
get_roms_by_fs_name / mark_missing_roms, and hash-based relocation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sk2dzM3K9qxWBdPAeGb7us
2026-06-21 20:46:50 +00:00
Georges-Antoine Assi
49f2b1659c Merge pull request #3272 from rommapp/claude/user-game-activity-monitoring-Mqb1v
Add real-time activity tracking for active game sessions
2026-06-21 12:02:58 -04:00
Georges-Antoine Assi
c6c7ce9ea6 cleanup 2026-06-21 11:13:30 -04:00
Georges-Antoine Assi
0460133992 Secure activity identity, cut Redis churn, remove v1 activity
Backend:
- Resolve the acting user from the authenticated socket session on
  connect instead of trusting the client-supplied user_id, so a client
  can no longer spoof a "now playing" session for another user. Only
  rom_id/device_id come from the payload.
- Emit activity:update/clear through the already-initialised socket
  server instead of opening (and leaking) a fresh AsyncRedisManager per
  REST heartbeat.
- Collapse get_all_active's per-key GET into a single MGET.
- Drop the pure pass-through _build_activity_entry helper.

Frontend:
- Remove all activity emits from the v1 EmulatorJS Player; the v2 shell
  is the single driver of the activity lifecycle.
- Remove activity from the v1 UI entirely (Activity view, ActivityBtn,
  ActivePlayers on game details, navigation, and the now-v2-only route).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:12:18 -04:00
androosio
b96a1dda2a fix: guard SiblingBadge against missing sibling_roms
The `scan:scanning_rom` socket emit strips `sibling_roms` from the rom
payload, so a freshly-scanned rom can reach SiblingBadge with the field
undefined (despite the schema typing it as required). Reading
`.length`/`.map` then threw `TypeError: Cannot read properties of
undefined (reading 'length')`, crashing the gallery during a scan while
"Group ROMs" was enabled.

Default `sibling_roms` to an empty list (a `siblings` computed). REST
payloads always include it (possibly empty), so only the socket path was
affected.

Closes #3567

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 17:11:16 +02:00
Georges-Antoine Assi
8aaa52bcb2 wire up v2 ui 2026-06-21 08:07:00 -04:00
Georges-Antoine Assi
429e718a14 add ui for v2 2026-06-20 21:09:11 -04:00
Georges-Antoine Assi
1caa6386c2 Translate activity.json into all locales
Add activity.json translations for every non-en_US locale and add the
matching `activity` key (added with the activity feature but left
English-only) to each common.json, so check_i18n_locales.py passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 13:48:47 -04:00
Georges-Antoine Assi
892a1b18e1 Merge branch 'master' into claude/user-game-activity-monitoring-Mqb1v 2026-06-20 13:42:11 -04:00
zurdi
33a98d32a5 style: adjust tooltip padding for better visual alignment 2026-06-20 16:14:17 +00:00
zurdi
b94badf502 Merge remote-tracking branch 'refs/remotes/origin/master' 2026-06-20 16:12:45 +00:00
zurdi
b7a7f6a5e3 feat: enhance user permissions and UI elements for better access control 2026-06-20 16:12:05 +00:00
Zurdi
cce2587024 Merge pull request #3557 from rommapp/feat/logs-view
feat: real-time backend logs view
2026-06-20 17:54:23 +02:00
zurdi
78cac11913 feat: add DISABLE_LOGS_VIEWER configuration and implement checks in logs endpoints and frontend 2026-06-20 15:48:58 +00:00
zurdi
78eef900b9 feat: update logs endpoint to require 'logs.read' scope and adjust related authorization checks 2026-06-20 09:55:10 +00:00
Zurdi
26c853f1cd Merge pull request #3554 from rommapp/feat/add-debug-overlay
feat: Add debug overlay
2026-06-20 11:23:19 +02:00
zurdi
90777d5cbb refactor: address Copilot review on debug overlay
- Lazy-load DebugOverlay via defineAsyncComponent so its chunk (and the
  vueuse perf hooks it pulls in) stays out of the default bundle until the
  developer toggle is enabled.
- Add useDebugMode unit tests mirroring useCrtMode: default-off, persisted
  restore, write-through, and singleton sharing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 09:21:43 +00:00
Georges-Antoine Assi
0e016eca9b Merge branch 'master' into claude/user-game-activity-monitoring-Mqb1v 2026-06-19 21:11:05 -04:00
Zurdi
4b58479232 Merge pull request #3556 from rommapp/feat/add-dropzone-to-savestates
feat: Add dropzone to saves/states
2026-06-20 01:02:14 +02:00
zurdi
8b70e31828 refactor: address Copilot review on logs feature
- main.py: await the cancelled log-forwarder task (suppressing
  CancelledError) so its pubsub/lock cleanup finishes before shutdown.
- forwarder: only heartbeat the Redis lock while we still own it; if a
  stall let another worker take it, relinquish forwarding to avoid
  duplicate lines (the outer loop re-contends).
- endpoints/logs.py: derive MAX_LOG_LIMIT from LOG_BUFFER_SIZE so the
  REST backfill never drifts from the producer's ring buffer.
- Logs.vue: append the download <a> to the DOM before click() (matches
  the Patcher pattern) for cross-browser reliability.
- Add tests/endpoints/test_logs.py: non-admin 403, limit clamping to
  [1, MAX_LOG_LIMIT], oldest-first ordering, and malformed-entry skip.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 20:53:58 +00:00
zurdi
ad543d93ee feat: add logs feature with internationalization support
- Introduced a new logs view for admin users, allowing real-time monitoring of backend logs.
- Implemented a log entry streaming mechanism using Socket.IO.
- Added filtering and searching capabilities for log entries.
- Created localized log messages in Spanish, French, Hungarian, Italian, Japanese, Korean, Polish, Portuguese, Romanian, Russian, Simplified Chinese, and Traditional Chinese.
- Updated router and sidebar components to include the new logs route.
- Enhanced user interface with tooltips and buttons for copying and downloading logs.
2026-06-19 16:06:50 +00:00
zurdi
40f7e49b11 feat: integrate dropzone for file uploads in SaveDataTab component 2026-06-19 14:52:59 +00:00
zurdi
67e70b21c1 fix: enhance platform refresh during scan completion and add new platforms to store 2026-06-19 14:43:33 +00:00
zurdi
eb1b477013 feat: add debug overlay with localization support for multiple languages 2026-06-19 13:06:26 +00:00
zurdi
fcccb5d583 feat: add random game button and localization for random ROM functionality 2026-06-19 12:40:10 +00:00
zurdi
68793c1f93 fix: game card reveal animation as global utility 2026-06-19 12:17:58 +00:00
Zurdi
c2d1bc592e Merge pull request #3552 from rommapp/feat/crt-mode
feat: CRT mode as a theme setting
2026-06-19 13:56:34 +02:00
Zurdi
24f8e6eb66 Merge pull request #3551 from rommapp/feat/add-user-avatar-to-notes
feat: Add user avatar to shared assets like notes or screenshots
2026-06-19 13:40:08 +02:00
Zurdi
2abb986d53 Merge pull request #3550 from rommapp/feat/backend-disconnect-warning
feat: backend connection status notice + offline-aware boot
2026-06-19 13:39:27 +02:00
zurdi
2fab0f0ab4 add tests for useCrtMode composable functionality 2026-06-19 11:47:03 +02:00
Zurdi
2e6fee639a Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-19 11:41:06 +02:00
Zurdi
58301e5add Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-19 11:39:54 +02:00
Zurdi
8f8418030c Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-19 11:39:44 +02:00
Zurdi
e1f5dcf090 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-19 11:36:39 +02:00
zurdi
1cc76de47d fix: improve error handling and connection state management in API and heartbeat 2026-06-19 11:35:15 +02:00
zurdi
1b05ffc6c2 fix: update pluralization in Spanish translations and improve file upload handling in RDropzone 2026-06-19 11:06:30 +02:00
zurdi
54b403a38e Merge remote-tracking branch 'origin/master' into feat/add-user-avatar-to-notes 2026-06-19 07:48:36 +00:00
zurdi
2997f984ff Merge remote-tracking branch 'origin/master' into feat/backend-disconnect-warning 2026-06-19 07:48:12 +00:00
zurdi
53d0b9f841 Merge remote-tracking branch 'origin/master' into feat/crt-mode 2026-06-19 07:47:49 +00:00
zurdi
f1dd8b6e90 Merge remote-tracking branch 'origin/master' into fix/gallery-animation 2026-06-19 07:47:29 +00:00
zurdi
d5c985f634 Merge remote-tracking branch 'origin/master' into feat/screenshot-CRUD-endpoints 2026-06-19 07:35:07 +00:00
zurdi
80b1dba7b8 feat: enhance gallery card animations with blur-up reveal effect 2026-06-19 07:32:45 +00:00
Georges-Antoine Assi
8922c2dd12 changes forom bot review 2026-06-18 13:27:41 -04:00
zurdi
2033e6cc5e feat: add CRT mode description to localization files and implement toggle in settings 2026-06-18 16:05:31 +00:00
Georges-Antoine Assi
8bf7d18afe cleanup 2026-06-18 11:48:51 -04:00
Georges-Antoine Assi
d3390b9d47 Add rom.sort-key translation to all locales
Backfill the `sort-key` key (added to en_US/en_GB) across the remaining 15
locale rom.json files with translations, so check_i18n_locales passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:42:59 -04:00
zurdi
a4d31d3791 feat: implement backend connection status handling with user notifications 2026-06-18 15:40:23 +00:00
Georges-Antoine Assi
a38ebe29b5 Preserve custom name_sort_key; gate derivation on "still derived"
Drop the name_sort_key_custom flag/migration in favour of a flagless rule: a
key is "custom" when it no longer equals compute(name). Apply that consistently
across all three write paths so a manual sort key survives renames while a
derived key keeps following the name:

- @validates re-derives on name assignment only when the stored key still
  matches the derived value; direct name_sort_key assignment stores a
  normalized custom key (or reverts to derived when cleared). Handles both
  kwarg orders at construction.
- update_rom mirrors the same check for the bulk update() path it bypasses.
- The edit endpoint only writes the key when the user actually changed the
  field, delegating the untouched case to update_rom.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:30:40 -04:00
Georges-Antoine Assi
cd19d723fa Merge sort_name into name_sort_key with custom-override flag
Collapse the separate `sort_name` column into `name_sort_key`, which is now
the single user-settable sort field: always normalized and indexed for fast
ordering, derived from `name` by default, and overridable. A new
`name_sort_key_custom` boolean marks user/metadata overrides so they survive
renames and rescans.

- Drop the `roms.sort_name` column; repurpose migration 0085 to add
  `name_sort_key_custom`.
- Derive the key via `@validates("name")` unless pinned custom; the edit
  dialog, unmatch flow, and ES-DE gamelist <sortname> set custom keys.
- update_rom / scan_rom keep the columns in sync explicitly (bulk update and
  construction bypass / reorder the validator).
- Frontend: edit field drives name_sort_key (empty when auto), api sends the
  override only when custom, regenerated types updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 10:34:21 -04:00
zurdi
d4a6d97acb feat: add user avatar and updated timestamp to community screenshots 2026-06-18 14:20:54 +00:00