From f9f29855b96bd2ae3aa5af3f1f9f4c20c7b79eae Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Tue, 14 Apr 2026 11:25:46 -0400 Subject: [PATCH] fix: bitrate field should be str not int (accepts values like 185M) --- backend/app/models.py | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/backend/app/models.py b/backend/app/models.py index 118fb56..f58a0fe 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -27,10 +27,10 @@ class RecorderConfig(BaseModel): port_index: int = Field(..., description="Index of the recorder port (0-based)") codec: CodecType = Field(..., description="Selected codec for recording") - bitrate: int = Field(..., description="Target bitrate in Mbps") + bitrate: str = Field(default="185M", description="Target bitrate (e.g. 185M, 50M)") quality_profile: str = Field( - ..., - description="Quality profile name (high, medium, low)" + default="hq", + description="Quality profile name (hq, mq, lq)" ) recording_path: str = Field( ..., @@ -39,11 +39,9 @@ class RecorderConfig(BaseModel): srt_enabled: bool = Field( default=False, description="Enable SRT streaming output" ) - # Legacy single destination (kept for backwards compat) srt_destination: Optional[str] = Field( - default=None, description="SRT destination address (host:port) — use srt_destinations for multi" + default=None, description="SRT destination address — use srt_destinations for multi" ) - # Multi-destination srt_destinations: List[SRTDestination] = Field( default_factory=list, description="List of SRT output destinations" ) @@ -73,27 +71,11 @@ class SCTE35Marker(BaseModel): """SCTE-35/SCTE-104 advertisement marker""" model_config = ConfigDict(use_enum_values=False) - event_id: str = Field( - ..., description="Unique identifier for this ad break event" - ) - duration_seconds: int = Field( - ..., description="Duration of the ad break in seconds" - ) - out_of_network: bool = Field( - ..., description="Whether this is an out-of-network ad" - ) - splice_immediate: bool = Field( - ..., description="Whether splice should happen immediately" - ) - timestamp: datetime = Field( - ..., description="Timestamp when marker was created/triggered" - ) - webhook_url: Optional[str] = Field( - default=None, description="Webhook URL to notify on ad break" - ) - port_index: Optional[int] = Field( - default=None, description="Port index this marker was injected on (None = global)" - ) - srt_destination_url: Optional[str] = Field( - default=None, description="Specific SRT destination URL this marker targets (None = all)" - ) + event_id: str = Field(..., description="Unique identifier for this ad break event") + duration_seconds: int = Field(..., description="Duration of the ad break in seconds") + out_of_network: bool = Field(..., description="Whether this is an out-of-network ad") + splice_immediate: bool = Field(..., description="Whether splice should happen immediately") + timestamp: datetime = Field(..., description="Timestamp when marker was created/triggered") + webhook_url: Optional[str] = Field(default=None, description="Webhook URL to notify on ad break") + port_index: Optional[int] = Field(default=None, description="Port index (None = global)") + srt_destination_url: Optional[str] = Field(default=None, description="Target SRT destination (None = all)")