ComfyUI/app/assets/services
Luke Mino-Altherr 069b7979ef refactor: use explicit dataclasses instead of ORM objects in service layer
Replace dict/ORM object returns with explicit dataclasses to fix
DetachedInstanceError when accessing ORM attributes after session closes.

- Add app/assets/services/schemas.py with AssetData, AssetInfoData,
  AssetDetailResult, and RegisterAssetResult dataclasses
- Update asset_management.py and ingest.py to return dataclasses
- Update manager.py to use attribute access on dataclasses
- Fix created_new to be False in create_asset_from_hash (content exists)
- Add DependencyMissingError for better blake3 missing error handling
- Update tests to use attribute access instead of dict subscripting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 11:34:44 -08:00
..
__init__.py Refactor asset database: separate business logic from queries 2026-02-24 11:34:43 -08:00
asset_management.py refactor: use explicit dataclasses instead of ORM objects in service layer 2026-02-24 11:34:44 -08:00
hashing.py fix: handle missing blake3 module gracefully to prevent server crash 2026-02-24 11:34:44 -08:00
ingest.py refactor: use explicit dataclasses instead of ORM objects in service layer 2026-02-24 11:34:44 -08:00
path_utils.py refactor: improve function naming for clarity and consistency 2026-02-24 11:34:44 -08:00
scanner.py refactor: remove try-finally wrapper in seed_assets by extracting helpers 2026-02-24 11:34:44 -08:00
schemas.py refactor: use explicit dataclasses instead of ORM objects in service layer 2026-02-24 11:34:44 -08:00
tagging.py refactor: move in-function imports to top-level and remove keyword-only argument pattern 2026-02-24 11:34:43 -08:00