mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
move RecordingsToDelete class to models.py
This commit is contained in:
parent
6afba3a6c7
commit
094cbe9beb
@ -66,3 +66,8 @@ class Recordings(Model): # type: ignore[misc]
|
|||||||
motion = IntegerField(null=True)
|
motion = IntegerField(null=True)
|
||||||
objects = IntegerField(null=True)
|
objects = IntegerField(null=True)
|
||||||
segment_size = FloatField(default=0) # this should be stored as MB
|
segment_size = FloatField(default=0) # this should be stored as MB
|
||||||
|
|
||||||
|
|
||||||
|
# Used for temporary table in record/cleanup.py
|
||||||
|
class RecordingsToDelete(Model): # type: ignore[misc]
|
||||||
|
id = CharField(null=False, primary_key=False, max_length=30)
|
||||||
|
|||||||
@ -7,21 +7,17 @@ import os
|
|||||||
import threading
|
import threading
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from peewee import chunked, DoesNotExist, DatabaseError, Model, CharField
|
from peewee import chunked, DoesNotExist, DatabaseError
|
||||||
from multiprocessing.synchronize import Event as MpEvent
|
from multiprocessing.synchronize import Event as MpEvent
|
||||||
|
|
||||||
from frigate.config import RetainModeEnum, FrigateConfig
|
from frigate.config import RetainModeEnum, FrigateConfig
|
||||||
from frigate.const import RECORD_DIR, SECONDS_IN_DAY
|
from frigate.const import RECORD_DIR, SECONDS_IN_DAY
|
||||||
from frigate.models import Event, Recordings, Timeline
|
from frigate.models import Event, Recordings, Timeline, RecordingsToDelete
|
||||||
from frigate.record.util import remove_empty_directories
|
from frigate.record.util import remove_empty_directories
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RecordingsToDelete(Model):
|
|
||||||
id = CharField(null=False, primary_key=False, max_length=30)
|
|
||||||
|
|
||||||
|
|
||||||
class RecordingCleanup(threading.Thread):
|
class RecordingCleanup(threading.Thread):
|
||||||
"""Cleanup existing recordings based on retention config."""
|
"""Cleanup existing recordings based on retention config."""
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user