Skip to content

Commit 1c95eb2

Browse files
authored
Add API to handle deleting recordings (#21520)
* Add recording delete API * Re-organize recordings apis * Fix import * Consolidate query types
1 parent 26744ef commit 1c95eb2

File tree

6 files changed

+511
-354
lines changed

6 files changed

+511
-354
lines changed

frigate/api/defs/query/media_query_parameters.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from enum import Enum
2-
from typing import Optional, Union
2+
from typing import Optional
33

44
from pydantic import BaseModel
5-
from pydantic.json_schema import SkipJsonSchema
65

76

87
class Extension(str, Enum):
@@ -48,15 +47,3 @@ class MediaMjpegFeedQueryParams(BaseModel):
4847
mask: Optional[int] = None
4948
motion: Optional[int] = None
5049
regions: Optional[int] = None
51-
52-
53-
class MediaRecordingsSummaryQueryParams(BaseModel):
54-
timezone: str = "utc"
55-
cameras: Optional[str] = "all"
56-
57-
58-
class MediaRecordingsAvailabilityQueryParams(BaseModel):
59-
cameras: str = "all"
60-
before: Union[float, SkipJsonSchema[None]] = None
61-
after: Union[float, SkipJsonSchema[None]] = None
62-
scale: int = 30
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from typing import Optional, Union
2+
3+
from pydantic import BaseModel
4+
from pydantic.json_schema import SkipJsonSchema
5+
6+
7+
class MediaRecordingsSummaryQueryParams(BaseModel):
8+
timezone: str = "utc"
9+
cameras: Optional[str] = "all"
10+
11+
12+
class MediaRecordingsAvailabilityQueryParams(BaseModel):
13+
cameras: str = "all"
14+
before: Union[float, SkipJsonSchema[None]] = None
15+
after: Union[float, SkipJsonSchema[None]] = None
16+
scale: int = 30
17+
18+
19+
class RecordingsDeleteQueryParams(BaseModel):
20+
keep: Optional[str] = None
21+
cameras: Optional[str] = "all"

frigate/api/defs/tags.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
class Tags(Enum):
55
app = "App"
6+
auth = "Auth"
67
camera = "Camera"
7-
preview = "Preview"
8+
events = "Events"
9+
export = "Export"
10+
classification = "Classification"
811
logs = "Logs"
912
media = "Media"
1013
notifications = "Notifications"
14+
preview = "Preview"
15+
recordings = "Recordings"
1116
review = "Review"
12-
export = "Export"
13-
events = "Events"
14-
classification = "Classification"
15-
auth = "Auth"

frigate/api/fastapi_app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
media,
2323
notification,
2424
preview,
25+
record,
2526
review,
2627
)
2728
from frigate.api.auth import get_jwt_secret, limiter, require_admin_by_default
@@ -128,6 +129,7 @@ async def startup():
128129
app.include_router(export.router)
129130
app.include_router(event.router)
130131
app.include_router(media.router)
132+
app.include_router(record.router)
131133
# App Properties
132134
app.frigate_config = frigate_config
133135
app.embeddings = embeddings

0 commit comments

Comments
 (0)