mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
treewide: apply black
This commit is contained in:
parent
3fc4e7be0a
commit
bc4071dde8
@ -90,7 +90,9 @@ class EventCleanup(threading.Thread):
|
|||||||
# loop over object types in db
|
# loop over object types in db
|
||||||
for event in distinct_labels:
|
for event in distinct_labels:
|
||||||
# get expiration time for this label
|
# get expiration time for this label
|
||||||
expire_days = retain_config.objects.get(event.label, retain_config.default)
|
expire_days = retain_config.objects.get(
|
||||||
|
event.label, retain_config.default
|
||||||
|
)
|
||||||
expire_after = (
|
expire_after = (
|
||||||
datetime.datetime.now() - datetime.timedelta(days=expire_days)
|
datetime.datetime.now() - datetime.timedelta(days=expire_days)
|
||||||
).timestamp()
|
).timestamp()
|
||||||
|
|||||||
@ -177,11 +177,7 @@ class TrackedObject:
|
|||||||
return (thumb_update, significant_change)
|
return (thumb_update, significant_change)
|
||||||
|
|
||||||
def to_dict(self, include_thumbnail: bool = False):
|
def to_dict(self, include_thumbnail: bool = False):
|
||||||
(
|
(self.thumbnail_data["frame_time"] if self.thumbnail_data is not None else 0.0)
|
||||||
self.thumbnail_data["frame_time"]
|
|
||||||
if self.thumbnail_data is not None
|
|
||||||
else 0.0
|
|
||||||
)
|
|
||||||
event = {
|
event = {
|
||||||
"id": self.obj_data["id"],
|
"id": self.obj_data["id"],
|
||||||
"camera": self.camera,
|
"camera": self.camera,
|
||||||
|
|||||||
@ -30,9 +30,15 @@ def migrate(migrator, database, fake=False, **kwargs):
|
|||||||
migrator.sql(
|
migrator.sql(
|
||||||
'CREATE TABLE IF NOT EXISTS "timeline" ("timestamp" DATETIME NOT NULL, "camera" VARCHAR(20) NOT NULL, "source" VARCHAR(20) NOT NULL, "source_id" VARCHAR(30), "class_type" VARCHAR(50) NOT NULL, "data" JSON)'
|
'CREATE TABLE IF NOT EXISTS "timeline" ("timestamp" DATETIME NOT NULL, "camera" VARCHAR(20) NOT NULL, "source" VARCHAR(20) NOT NULL, "source_id" VARCHAR(30), "class_type" VARCHAR(50) NOT NULL, "data" JSON)'
|
||||||
)
|
)
|
||||||
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")')
|
migrator.sql(
|
||||||
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_source" ON "timeline" ("source")')
|
'CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")'
|
||||||
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_source_id" ON "timeline" ("source_id")')
|
)
|
||||||
|
migrator.sql(
|
||||||
|
'CREATE INDEX IF NOT EXISTS "timeline_source" ON "timeline" ("source")'
|
||||||
|
)
|
||||||
|
migrator.sql(
|
||||||
|
'CREATE INDEX IF NOT EXISTS "timeline_source_id" ON "timeline" ("source_id")'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def rollback(migrator, database, fake=False, **kwargs):
|
def rollback(migrator, database, fake=False, **kwargs):
|
||||||
|
|||||||
@ -311,7 +311,6 @@ def process(path, label, output, debug_path):
|
|||||||
|
|
||||||
for result in results:
|
for result in results:
|
||||||
if count == 0:
|
if count == 0:
|
||||||
|
|
||||||
# Writing headers of CSV file
|
# Writing headers of CSV file
|
||||||
header = ["file"] + list(result[1].keys())
|
header = ["file"] + list(result[1].keys())
|
||||||
csv_writer.writerow(header)
|
csv_writer.writerow(header)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user