- Separate CaptureEngine into stateless factory + stateful CaptureStream session - Add LiveStream/LiveStreamManager for shared capture with reference counting - Rename PictureStream to PictureSource across storage, API, and UI - Remove legacy migration logic and unused compatibility code - Split monolithic routes.py (1935 lines) into 5 focused route modules - Split schemas.py (480 lines) into 7 schema modules with re-exports - Extract dependency injection into dedicated dependencies.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
2.1 KiB
Python
50 lines
2.1 KiB
Python
"""Postprocessing template schemas."""
|
|
|
|
from datetime import datetime
|
|
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from .filters import FilterInstanceSchema
|
|
|
|
|
|
class PostprocessingTemplateCreate(BaseModel):
|
|
"""Request to create a postprocessing template."""
|
|
|
|
name: str = Field(description="Template name", min_length=1, max_length=100)
|
|
filters: List[FilterInstanceSchema] = Field(default_factory=list, description="Ordered list of filter instances")
|
|
description: Optional[str] = Field(None, description="Template description", max_length=500)
|
|
|
|
|
|
class PostprocessingTemplateUpdate(BaseModel):
|
|
"""Request to update a postprocessing template."""
|
|
|
|
name: Optional[str] = Field(None, description="Template name", min_length=1, max_length=100)
|
|
filters: Optional[List[FilterInstanceSchema]] = Field(None, description="Ordered list of filter instances")
|
|
description: Optional[str] = Field(None, description="Template description", max_length=500)
|
|
|
|
|
|
class PostprocessingTemplateResponse(BaseModel):
|
|
"""Postprocessing template information response."""
|
|
|
|
id: str = Field(description="Template ID")
|
|
name: str = Field(description="Template name")
|
|
filters: List[FilterInstanceSchema] = Field(description="Ordered list of filter instances")
|
|
created_at: datetime = Field(description="Creation timestamp")
|
|
updated_at: datetime = Field(description="Last update timestamp")
|
|
description: Optional[str] = Field(None, description="Template description")
|
|
|
|
|
|
class PostprocessingTemplateListResponse(BaseModel):
|
|
"""List of postprocessing templates response."""
|
|
|
|
templates: List[PostprocessingTemplateResponse] = Field(description="List of postprocessing templates")
|
|
count: int = Field(description="Number of templates")
|
|
|
|
|
|
class PPTemplateTestRequest(BaseModel):
|
|
"""Request to test a postprocessing template against a source stream."""
|
|
|
|
source_stream_id: str = Field(description="ID of the source picture source to capture from")
|
|
capture_duration: float = Field(default=5.0, ge=1.0, le=30.0, description="Duration to capture in seconds")
|