feat(schema): implement pydantic schemas and tempo conversion logic

This commit is contained in:
2026-11-02 10:04:53 +01:00
parent ccbbc3685f
commit 945391ff23
11 changed files with 735 additions and 0 deletions

View File

@ -0,0 +1,43 @@
"""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)