ComfyUI/app/assets/services
Luke Mino-Altherr abeec3072b refactor(assets): extract scanner logic into service modules
- Create file_utils.py with shared file utilities:
  - get_mtime_ns() - extract mtime in nanoseconds from stat
  - get_size_and_mtime_ns() - get both size and mtime
  - verify_file_unchanged() - check file matches DB mtime/size
  - list_files_recursively() - recursive directory listing

- Create bulk_ingest.py for bulk operations:
  - BulkInsertResult dataclass
  - batch_insert_seed_assets() - batch insert with conflict handling
  - prune_orphaned_assets() - clean up orphaned assets

- Update scanner.py to use new service modules instead of
  calling database queries directly

- Update ingest.py to use shared get_size_and_mtime_ns()

- Export new functions from services/__init__.py

Amp-Thread-ID: https://ampcode.com/threads/T-019c2ae7-f701-716a-a0dd-1feb988732fb
Co-authored-by: Amp <amp@ampcode.com>
2026-02-04 15:17:31 -08:00
..
__init__.py refactor(assets): extract scanner logic into service modules 2026-02-04 15:17:31 -08:00
asset_management.py refactor(assets): consolidate duplicated query utilities and remove unused code 2026-02-04 15:04:30 -08:00
bulk_ingest.py refactor(assets): extract scanner logic into service modules 2026-02-04 15:17:31 -08:00
file_utils.py refactor(assets): extract scanner logic into service modules 2026-02-04 15:17:31 -08:00
hashing.py refactor: require blake3 package directly in hashing module 2026-02-03 20:42:11 -08:00
ingest.py refactor(assets): extract scanner logic into service modules 2026-02-04 15:17:31 -08:00
path_utils.py refactor(assets): consolidate duplicated query utilities and remove unused code 2026-02-04 15:04:30 -08:00
schemas.py refactor: eliminate manager layer, routes call services directly 2026-02-04 14:50:11 -08:00
tagging.py refactor: add explicit types to asset service functions 2026-02-03 20:32:14 -08:00