mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-13 06:35:24 +03:00
Fix comparison and preview retrieval
This commit is contained in:
parent
6fd5b2c8b7
commit
95385c8aa7
@ -155,7 +155,6 @@ def export_delete(id: str):
|
|||||||
except psutil.Error:
|
except psutil.Error:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.error(f"comparing {export.video_path.split('/')[-1]} to {files_in_use}")
|
|
||||||
if export.video_path.split("/")[-1] in files_in_use:
|
if export.video_path.split("/")[-1] in files_in_use:
|
||||||
return make_response(
|
return make_response(
|
||||||
jsonify(
|
jsonify(
|
||||||
|
|||||||
@ -11,6 +11,8 @@ import threading
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from peewee import DoesNotExist
|
||||||
|
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.const import (
|
from frigate.const import (
|
||||||
CACHE_DIR,
|
CACHE_DIR,
|
||||||
@ -72,8 +74,11 @@ class RecordingExporter(threading.Thread):
|
|||||||
|
|
||||||
if datetime.datetime.fromtimestamp(
|
if datetime.datetime.fromtimestamp(
|
||||||
self.start_time
|
self.start_time
|
||||||
) < datetime.datetime.now().replace(minute=0, second=0):
|
) < datetime.datetime.now().astimezone(datetime.timezone.dst).replace(
|
||||||
|
minute=0, second=0, microsecond=0
|
||||||
|
):
|
||||||
# has preview mp4
|
# has preview mp4
|
||||||
|
try:
|
||||||
preview: Previews = (
|
preview: Previews = (
|
||||||
Previews.select(
|
Previews.select(
|
||||||
Previews.camera,
|
Previews.camera,
|
||||||
@ -94,8 +99,7 @@ class RecordingExporter(threading.Thread):
|
|||||||
.limit(1)
|
.limit(1)
|
||||||
.get()
|
.get()
|
||||||
)
|
)
|
||||||
|
except DoesNotExist:
|
||||||
if not preview:
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
diff = self.start_time - preview.start_time
|
diff = self.start_time - preview.start_time
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user