Add optional blake3 hashing during asset scanning

- Make blake3 import lazy in hashing.py (only imported when needed)
- Add compute_hashes parameter to AssetSeeder.start(), build_asset_specs(), and seed_assets()
- Fix missing tag clearing: include is_missing states in sync when update_missing_tags=True
- Clear is_missing flag on cache states when files are restored with matching mtime/size
- Fix validation error serialization in routes.py (use json.loads(ve.json()))

Amp-Thread-ID: https://ampcode.com/threads/T-019c3614-56d4-74a8-a717-19922d6dbbee
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Luke Mino-Altherr
2026-02-06 19:22:56 -08:00
parent 7a75af59ab
commit a2d26dece5
11 changed files with 119 additions and 52 deletions

View File

@@ -36,6 +36,7 @@ class SeedAssetSpec(TypedDict):
tags: list[str]
fname: str
metadata: ExtractedMetadata | None
hash: str | None
class AssetRow(TypedDict):
@@ -163,7 +164,7 @@ def batch_insert_seed_assets(
asset_rows.append(
{
"id": asset_id,
"hash": None,
"hash": spec.get("hash"),
"size_bytes": spec["size_bytes"],
"mime_type": None,
"created_at": current_time,