Add TypedDict types to scanner and bulk_ingest

Amp-Thread-ID: https://ampcode.com/threads/T-019c2af9-4d41-73e9-b38d-78d06bc28a3f
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Luke Mino-Altherr
2026-02-04 15:32:26 -08:00
parent 16b5d9112b
commit fa3749ced7
2 changed files with 33 additions and 6 deletions

View File

@@ -1,9 +1,21 @@
import os
import uuid
from dataclasses import dataclass
from typing import TypedDict
from sqlalchemy.orm import Session
class SeedAssetSpec(TypedDict):
"""Spec for seeding an asset from filesystem."""
abs_path: str
size_bytes: int
mtime_ns: int
info_name: str
tags: list[str]
fname: str
from app.assets.database.queries import (
bulk_insert_asset_infos_ignore_conflicts,
bulk_insert_assets,
@@ -29,7 +41,7 @@ class BulkInsertResult:
def batch_insert_seed_assets(
session: Session,
specs: list[dict],
specs: list[SeedAssetSpec],
owner_id: str = "",
) -> BulkInsertResult:
"""Seed assets from filesystem specs in batch.