Skip to content

Commit

Permalink
treewide: apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
mweinelt committed May 23, 2023
1 parent 3fc4e7b commit bc4071d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion frigate/events/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def expire(self, media_type: str) -> None:
# loop over object types in db
for event in distinct_labels:
# 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 = (
datetime.datetime.now() - datetime.timedelta(days=expire_days)
).timestamp()
Expand Down
6 changes: 1 addition & 5 deletions frigate/object_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,7 @@ def update(self, current_frame_time, obj_data):
return (thumb_update, significant_change)

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 = {
"id": self.obj_data["id"],
"camera": self.camera,
Expand Down
12 changes: 9 additions & 3 deletions migrations/013_create_timeline_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ def migrate(migrator, database, fake=False, **kwargs):
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)'
)
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")')
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")')
migrator.sql(
'CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")'
)
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):
Expand Down
1 change: 0 additions & 1 deletion process_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def process(path, label, output, debug_path):

for result in results:
if count == 0:

# Writing headers of CSV file
header = ["file"] + list(result[1].keys())
csv_writer.writerow(header)
Expand Down

0 comments on commit bc4071d

Please sign in to comment.