diff --git a/frigate/models.py b/frigate/models.py index f90aa1769..179759430 100644 --- a/frigate/models.py +++ b/frigate/models.py @@ -66,7 +66,7 @@ class Recordings(Model): # type: ignore[misc] duration = FloatField() motion = IntegerField(null=True) objects = IntegerField(null=True) - audio = IntegerField(null=True) # audio events in this recording + audio = BooleanField(default=False) # audio events in this recording segment_size = FloatField(default=0) # this should be stored as MB diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 4459eb285..23833bd01 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -342,7 +342,7 @@ class RecordingMaintainer(threading.Thread): motion=motion_count, # TODO: update this to store list of active objects at some point objects=active_count, - audio=1 if audio_event else 0, + audio=audio_event, segment_size=segment_size, ) except Exception as e: diff --git a/migrations/018_add_recording_audio.py b/migrations/018_add_recording_audio.py index 1d74deffd..12508597a 100644 --- a/migrations/018_add_recording_audio.py +++ b/migrations/018_add_recording_audio.py @@ -31,7 +31,7 @@ SQL = pw.SQL def migrate(migrator, database, fake=False, **kwargs): migrator.add_fields( Recordings, - audio=pw.IntegerField(null=True), + audio=pw.BooleanField(default=False), )