mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-30 19:31:25 +00:00
refactor: eliminate manager layer, routes call services directly
- Delete app/assets/manager.py - Move upload logic (upload_from_temp_path, create_from_hash) to ingest service - Add HashMismatchError and DependencyMissingError to ingest service - Add UploadResult schema for upload responses - Update routes.py to import services directly and do schema conversion inline - Add asset lookup/listing service functions to asset_management.py Routes now call the service layer directly, removing an unnecessary layer of indirection. The manager was only converting between service dataclasses and Pydantic response schemas. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,34 @@ class TagUsage(NamedTuple):
|
||||
count: int
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AssetSummaryData:
|
||||
info: AssetInfoData
|
||||
asset: AssetData | None
|
||||
tags: list[str]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ListAssetsResult:
|
||||
items: list[AssetSummaryData]
|
||||
total: int
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DownloadResolutionResult:
|
||||
abs_path: str
|
||||
content_type: str
|
||||
download_name: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class UploadResult:
|
||||
info: AssetInfoData
|
||||
asset: AssetData
|
||||
tags: list[str]
|
||||
created_new: bool
|
||||
|
||||
|
||||
def extract_info_data(info: AssetInfo) -> AssetInfoData:
|
||||
return AssetInfoData(
|
||||
id=info.id,
|
||||
|
||||
Reference in New Issue
Block a user