Commit Graph

10 Commits

Author SHA1 Message Date
Georges-Antoine Assi
aea09911ad cleanup 2026-06-18 07:57:09 -04: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
Georges-Antoine Assi
0a3c190cc5 use utc_now func 2025-09-17 11:14:03 -04:00
Georges-Antoine Assi
d0a8f6fa4f [ROMM-2416] Use python timezone aware datetime as defaults for create_at/updated_at 2025-09-17 10:49:05 -04:00
Georges-Antoine Assi
aaf6741e93 Create safe filesystem handler 2025-07-17 12:30:57 -04:00
Georges-Antoine Assi
195b0cf742 [HOTFIX] Change all DateTime columns to TIMESTAMP 2025-01-13 21:53:00 -05: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
ebe557c6f0 Refactor + add tests for igdb handler 2023-08-01 00:20:09 -04:00
Georges-Antoine Assi
917dbc3295 Rewrite dev setup, switch to poetry and refactor folder strucutre 2023-05-08 19:01:21 -04:00