mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix preview failing on cameras with - in name (#12093)
This commit is contained in:
parent
b34be991bd
commit
3410290b45
@ -219,13 +219,16 @@ class PreviewRecorder:
|
|||||||
os.unlink(os.path.join(PREVIEW_CACHE_DIR, file))
|
os.unlink(os.path.join(PREVIEW_CACHE_DIR, file))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
file_time = file.split("-")[1][: -(len(PREVIEW_FRAME_TYPE) + 1)]
|
try:
|
||||||
|
file_time = file.split("-")[-1][: -(len(PREVIEW_FRAME_TYPE) + 1)]
|
||||||
|
|
||||||
if not file_time:
|
if not file_time:
|
||||||
|
continue
|
||||||
|
|
||||||
|
ts = float(file_time)
|
||||||
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
ts = float(file_time)
|
|
||||||
|
|
||||||
if self.start_time == 0:
|
if self.start_time == 0:
|
||||||
self.start_time = ts
|
self.start_time = ts
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user