Commit Graph

54 Commits

Author SHA1 Message Date
Georges-Antoine Assi
c94b92afdd self cleanup 2026-07-01 09:06:12 -04:00
Georges-Antoine Assi
71d5d3a47f refactor raw endpoint 2026-07-01 08:58:00 -04:00
zurdi
9106c3721e feat: add visibility toggle for saves and states, enhance community sections
- Introduced new API endpoints for updating visibility of saves and states.
- Added `is_public` property to `SaveSchema` and `StateSchema`.
- Created new models for user saves and states with visibility attributes.
- Updated the `SaveDataTab` component to differentiate between "Mine" and "Community" sections.
- Implemented visibility toggle functionality for user saves and states.
- Enhanced localization files to include new strings for visibility actions.
2026-06-21 14:00:02 +00:00
zurdi
2772ecb239 Merge remote-tracking branch 'origin/master' into feat/screenshot-CRUD-endpoints 2026-06-18 12:58:31 +00:00
zurdi
a8d2fcb605 feat: implement RDropzone component for file uploads with drag-and-drop support
- Added RDropzone component for handling file uploads with a customizable interface.
- Integrated RDropzone into Patcher and Upload views, replacing previous drop zone implementations.
- Enhanced ScreenshotsTab with additional functionality for community screenshots, including visibility toggles and owner display.
- Updated styles for improved user experience and responsiveness.
- Created Storybook stories for RDropzone to demonstrate its usage and interaction.
2026-06-18 11:05:52 +00:00
Georges-Antoine Assi
987e351113 refactor: derive file-name columns via @validates
Centralize the *_no_tags / *_no_ext / *_extension columns (derived from a
file name) behind @validates hooks instead of computing them by hand at
every write site:

- Add pure helpers (compute_file_name_parts and friends) to models.base;
  the filesystem base handler now delegates to them.
- Add @validates on Rom (fs_name), BaseAsset (file_name, inherited by all
  asset subclasses), and Firmware (file_name).
- update_rom keeps the fs_name-derived columns in sync on bulk update(),
  which also fixes the rename path never updating fs_extension.
- Drop the now-redundant computations at the scan/rename call sites.

Also fix the migration backfill loop and a pre-existing list[str | None]
type mismatch surfaced in scan_handler. Add tests for the helpers, the
validators, and the update_rom bulk-sync path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 21:14:16 -04:00
nendo
287c487308 feat(saves): expose per-device sync attribution and origin device
saves responses now include one device_syncs entry per device that has
synced a save, not just the caller's, so clients can tell which devices
hold a save. is_current is computed per entry and the caller's own entry
is ordered first for backward compatibility.

add a saves.origin_device_id column (migration 0081) recording the
device that created a save, set on initial upload only, surfaced as
origin_device_id on the save schema.
2026-06-05 20:25:01 +09:00
Georges-Antoine Assi
6461078721 loosen rules around fetch matching screenshots 2026-02-19 10:18:56 -05:00
Georges-Antoine Assi
bbb1ba3ec0 cahanges from bot review 2026-02-19 09:36:12 -05:00
Georges-Antoine Assi
5b1dfe2ba1 [ROMM-3031] Fix screenshot property on save/state 2026-02-18 23:23:35 -05:00
nendo
a236123e4f feat(saves): add slot-based save sync with content hash deduplication
- Add device registration and save synchronization
- Implement slot-based save organization with datetime tagging
- Add conflict detection for multi-device sync scenarios
- Add content hash computation for save deduplication
- Support ZIP inner-file hashing for consistent deduplication
- Add confirm_download endpoint for sync state management
- Add overwrite parameter to bypass conflict checks
2026-01-31 21:57:22 +09:00
nendo
36eec298d1 Add device-based save synchronization
Implement device registration and save sync tracking to enable
multi-device save management with conflict detection.

- Device CRUD endpoints (POST/GET/PUT/DELETE /api/devices)
- Save sync state tracking per device
- Conflict detection on upload (409 when device has stale sync)
- Download sync tracking (optimistic and confirmed modes)
- Track/untrack saves per device
- DEVICES_READ/WRITE scopes for authorization
2026-01-18 16:50:44 +09:00
Michael Manganiello
e4e3928d1b misc: Apply import sorting 2025-09-04 11:17:00 -03:00
Michael Manganiello
00d7815889 fix: Improve performance on asset screenshot retrieval
When retrieving the related screenshot for a `Save` or `State`, we were
retrieving a very heavy representation of the associated `Rom` object,
only to iterate through its screenshots to find the one we needed.

This change modifies the `Save` and `State` models to directly query the
`Screenshot` model, which is much faster and more efficient. The
`DBScreenshotsHandler` has been updated to include a new `filter` method
that will simplify building queries using SQLAlchemy, something we can
extend to other handlers in the future.

Fixes #1925.
2025-08-10 15:33:13 -03:00
Georges-Antoine Assi
aaf6741e93 Create safe filesystem handler 2025-07-17 12:30:57 -04:00
zurdi
8370b79a83 feat: add 'missing_from_fs' property to various schemas and update related logic for better tracking of missing files 2025-06-12 22:18:06 +00:00
zurdi
cb01b82846 feat: add 'missing' property to asset and firmware schemas for tracking missing entries 2025-06-12 12:24:30 +00:00
Georges-Antoine Assi
b6e0df7097 complete refactor of seleting saves and states 2025-03-26 18:49:12 -04:00
Georges-Antoine Assi
8750e343e5 Merge branch 'master' into misc/split-db-handler-logic-to-get-list 2024-06-30 19:24:59 -04:00
Michael Manganiello
8281d5679b misc: Split database handler logic to get/list entities
The current implementation for some of the database handlers, where the
same method is used to retrieve either a single entity (when an `id` is
passed), a list of entities, or `None`, makes the typing and overall
design more complex.

This change simplifies database handlers, by having two separate methods
where appropiate:

* A method that receives an `id`, and returns either an entity, or `None`.
* A method that optionally receives filters, and returns (depending on
  the current handler implementation) a list of entities, or a `Select`
  object that allows chaining more SQLAlchemy operations.
2024-06-30 13:12:48 -03:00
Michael Manganiello
e1bcd9cc06 misc: Use Python future annotations
Simplify annotations by using `__future__.annotations`, so there's no
need to add typing using types as strings.
2024-06-30 12:19:37 -03:00
Zurdi
dc479b289b fixes from trunk 2024-06-28 17:32:04 +02:00
Zurdi
d2fe08f525 added update_at and created_at to base model 2024-06-28 16:45:39 +02:00
Michael Manganiello
b99ededced misc: Migrate to SQLAlchemy declarative models
This change applies the guided migration process recommended by
SQLAlchemy [1], up to step 4, to have declarative ORM models that better
support Python typing.

The change was tested by running `alembic check`, which does not find
any schema changes.

Errors reported by `mypy` go down to 170, from the original 223 in the
current `master` commit.

[1] https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#migrating-an-existing-mapping
2024-06-25 23:03:20 -03:00
Georges-Antoine Assi
b075e93321 Merge branch 'master' into trunk-io 2024-05-24 16:47:19 -04:00
Georges-Antoine Assi
2d4d1b5ae3 improve roms loading time 2024-05-24 10:14:44 -04:00
Georges-Antoine Assi
a7cf0d389a run trunk format on all files 2024-05-21 10:18:13 -04:00
Georges-Antoine Assi
2749aaee4a rename back to old names 2024-05-05 16:59:30 -04:00
Georges-Antoine Assi
9ad28f3294 more refactoring again 2024-05-05 16:32:40 -04:00
Georges-Antoine Assi
def2608c28 refactor db handlers 2024-05-05 15:46:07 -04:00
Georges-Antoine Assi
dc64776e1d fixes for firmware ui 2024-05-05 15:12:55 -04:00
Georges-Antoine Assi
1a2c914045 refactor handlers out into own files 2024-05-05 12:45:56 -04:00
Georges-Antoine Assi
eca1eb1136 model and scanning 2024-05-01 15:27:16 -04:00
Georges-Antoine Assi
99e1ed4fe9 Add tables for firmware 2024-04-10 13:51:41 -04:00
Georges-Antoine Assi
c3e1f4f44c [ROMM-618] Add last logged in and last active for users 2024-04-06 15:29:40 -04:00
Georges-Antoine Assi
a21b48c42a squash migrations for 3.0 2024-02-08 15:16:24 -05:00
Georges-Antoine Assi
eb18388a81 Mega refactor of asset 2024-02-01 17:59:06 -05:00
Georges-Antoine Assi
89c16c7ec1 increase file extesnion assets 2024-01-27 13:09:28 -05:00
Georges-Antoine Assi
f7da369bcf correct saving screenshots for states 2024-01-20 22:07:02 -05:00
Georges-Antoine Assi
0ca6d74c26 Add file_name_no_ext column 2024-01-20 15:09:11 -05:00
Georges-Antoine Assi
dd4b149271 automatic state loading and saving 2024-01-19 11:20:40 -05:00
Georges-Antoine Assi
f3d44aae41 api endpoint for raw asset access 2024-01-18 09:48:57 -05:00
Zurdi
93f6cb7651 Merge branch 'feature/manage_config_from_ui' into refactor/backend 2024-01-13 02:17:19 +01:00
Zurdi
4b9e76f550 backend structure refactor 2024-01-12 23:44:27 +01:00
Georges-Antoine Assi
2b2f79cfb9 add created/updated at columns to assets 2024-01-07 09:52:34 -05:00
Georges-Antoine Assi
91d2562597 Support screenshots outside platforms 2024-01-06 17:24:51 -05:00
Georges-Antoine Assi
05da20963f remove support for bios and emulatores 2024-01-06 10:21:43 -05:00
Georges-Antoine Assi
2e9f581478 small fixes 2024-01-06 09:50:29 -05:00
Georges-Antoine Assi
678b6c2c98 Add support for emulator files related to platforms 2023-11-29 14:41:12 -05:00
Georges-Antoine Assi
8422c002c5 Support emulator folders 2023-11-26 22:43:03 -05:00