mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-03 10:31:14 +03:00
Mypy
This commit is contained in:
parent
3127952472
commit
df5e6c5936
@ -208,27 +208,29 @@ class ExportDebugReplaySource(DebugReplaySource):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, export: Export, duration: float) -> None:
|
def __init__(self, export: Export, duration: float) -> None:
|
||||||
self._export = export
|
self._camera = cast(str, export.camera)
|
||||||
|
self._start_ts = datetime.timestamp(cast(datetime, export.date))
|
||||||
|
self._video_path = cast(str, export.video_path)
|
||||||
self._duration = duration
|
self._duration = duration
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_camera(self) -> str:
|
def source_camera(self) -> str:
|
||||||
return self._export.camera
|
return self._camera
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def start_ts(self) -> float:
|
def start_ts(self) -> float:
|
||||||
return datetime.timestamp(self._export.date)
|
return self._start_ts
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def end_ts(self) -> float:
|
def end_ts(self) -> float:
|
||||||
return self.start_ts + self._duration
|
return self._start_ts + self._duration
|
||||||
|
|
||||||
def validate(self) -> None:
|
def validate(self) -> None:
|
||||||
if not os.path.exists(self._export.video_path):
|
if not os.path.exists(self._video_path):
|
||||||
raise ValueError(f"Export video file not found: {self._export.video_path}")
|
raise ValueError(f"Export video file not found: {self._video_path}")
|
||||||
|
|
||||||
def ffmpeg_input_args(self, working_dir: str) -> list[str]:
|
def ffmpeg_input_args(self, working_dir: str) -> list[str]:
|
||||||
return ["-i", self._export.video_path]
|
return ["-i", self._video_path]
|
||||||
|
|
||||||
|
|
||||||
class DebugReplayJobRunner(threading.Thread):
|
class DebugReplayJobRunner(threading.Thread):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user