44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
"""Schema for meta.json."""
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from songsplit.schema.base import SongPackageBase
|
|
|
|
|
|
class SourceFileInfo(BaseModel):
|
|
"""Information about the original source audio/video file."""
|
|
|
|
model_config = ConfigDict(extra="ignore")
|
|
|
|
path: str
|
|
sha256: str
|
|
size_bytes: int
|
|
|
|
|
|
class ModelInfo(BaseModel):
|
|
"""Information about an AI model used during processing."""
|
|
|
|
model_config = ConfigDict(extra="ignore")
|
|
|
|
stage: str
|
|
name: str
|
|
version: str
|
|
|
|
|
|
class MetaDocument(SongPackageBase):
|
|
"""Song-Paket metadata document (meta.json)."""
|
|
|
|
model_config = ConfigDict(extra="ignore")
|
|
|
|
title: str | None = None
|
|
artist: str | None = None
|
|
language: str | None = None
|
|
duration_sec: float = Field(ge=0.0)
|
|
source_file: SourceFileInfo
|
|
key: str | None = None
|
|
capo: int | None = None
|
|
models_used: list[ModelInfo] = Field(default_factory=list)
|
|
created_at: str
|
|
stages_done: list[str] = Field(default_factory=list)
|
|
stages_failed: dict[str, str] = Field(default_factory=dict)
|