mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-11-07 01:20:07 +01:00
* use custom swr fetcher to check for audio support The go2rtc API doesn't always return stream data for anything not being actively consumed, so audio support was not always being correctly deduced. So we can use a custom swr fetcher to call the endpoint that probes the streams, which returns the correct producers data. * return correct mime type for thumbnail and latest frame endpoints follow up to https://github.com/blakeblackshear/frigate/pull/19555
54 lines
1.3 KiB
Python
54 lines
1.3 KiB
Python
from enum import Enum
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class Extension(str, Enum):
|
|
webp = "webp"
|
|
png = "png"
|
|
jpg = "jpg"
|
|
jpeg = "jpeg"
|
|
|
|
def get_mime_type(self) -> str:
|
|
if self in (Extension.jpg, Extension.jpeg):
|
|
return "image/jpeg"
|
|
return f"image/{self.value}"
|
|
|
|
|
|
class MediaLatestFrameQueryParams(BaseModel):
|
|
bbox: Optional[int] = None
|
|
timestamp: Optional[int] = None
|
|
zones: Optional[int] = None
|
|
mask: Optional[int] = None
|
|
motion: Optional[int] = None
|
|
regions: Optional[int] = None
|
|
quality: Optional[int] = 70
|
|
height: Optional[int] = None
|
|
store: Optional[int] = None
|
|
|
|
|
|
class MediaEventsSnapshotQueryParams(BaseModel):
|
|
download: Optional[bool] = False
|
|
timestamp: Optional[int] = None
|
|
bbox: Optional[int] = None
|
|
crop: Optional[int] = None
|
|
height: Optional[int] = None
|
|
quality: Optional[int] = 70
|
|
|
|
|
|
class MediaMjpegFeedQueryParams(BaseModel):
|
|
fps: int = 3
|
|
height: int = 360
|
|
bbox: Optional[int] = None
|
|
timestamp: Optional[int] = None
|
|
zones: Optional[int] = None
|
|
mask: Optional[int] = None
|
|
motion: Optional[int] = None
|
|
regions: Optional[int] = None
|
|
|
|
|
|
class MediaRecordingsSummaryQueryParams(BaseModel):
|
|
timezone: str = "utc"
|
|
cameras: Optional[str] = "all"
|