mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-17 16:44:29 +03:00
Add export select by ID
This commit is contained in:
parent
309accddda
commit
bb932d0cc6
@ -17,8 +17,8 @@ from fastapi.responses import JSONResponse, PlainTextResponse
|
|||||||
from markupsafe import escape
|
from markupsafe import escape
|
||||||
from peewee import operator
|
from peewee import operator
|
||||||
|
|
||||||
from frigate.api.defs.request.app_body import AppConfigSetBody
|
|
||||||
from frigate.api.defs.app_query_parameters import AppTimelineHourlyQueryParameters
|
from frigate.api.defs.app_query_parameters import AppTimelineHourlyQueryParameters
|
||||||
|
from frigate.api.defs.request.app_body import AppConfigSetBody
|
||||||
from frigate.api.defs.tags import Tags
|
from frigate.api.defs.tags import Tags
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.const import CONFIG_DIR
|
from frigate.const import CONFIG_DIR
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import psutil
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
from peewee import DoesNotExist
|
from peewee import DoesNotExist
|
||||||
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
from frigate.api.defs.request.export_recordings_body import ExportRecordingsBody
|
from frigate.api.defs.request.export_recordings_body import ExportRecordingsBody
|
||||||
from frigate.api.defs.tags import Tags
|
from frigate.api.defs.tags import Tags
|
||||||
@ -207,3 +208,14 @@ def export_delete(event_id: str):
|
|||||||
),
|
),
|
||||||
status_code=200,
|
status_code=200,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/exports/{export_id}", response_model=Export)
|
||||||
|
def get_export(export_id: str):
|
||||||
|
try:
|
||||||
|
return JSONResponse(content=model_to_dict(Export.get(Export.id == export_id)))
|
||||||
|
except DoesNotExist:
|
||||||
|
return JSONResponse(
|
||||||
|
content={"success": False, "message": "Export not found"},
|
||||||
|
status_code=404,
|
||||||
|
)
|
||||||
|
|||||||
@ -12,13 +12,13 @@ from fastapi.responses import JSONResponse
|
|||||||
from peewee import Case, DoesNotExist, fn, operator
|
from peewee import Case, DoesNotExist, fn, operator
|
||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
from frigate.api.defs.response.generic_response import GenericResponse
|
from frigate.api.defs.query.review_query_parameters import (
|
||||||
from frigate.api.defs.request.review_body import ReviewModifyMultipleBody
|
|
||||||
from frigate.api.defs.review_query_parameters import (
|
|
||||||
ReviewActivityMotionQueryParams,
|
ReviewActivityMotionQueryParams,
|
||||||
ReviewQueryParams,
|
ReviewQueryParams,
|
||||||
ReviewSummaryQueryParams,
|
ReviewSummaryQueryParams,
|
||||||
)
|
)
|
||||||
|
from frigate.api.defs.request.review_body import ReviewModifyMultipleBody
|
||||||
|
from frigate.api.defs.response.generic_response import GenericResponse
|
||||||
from frigate.api.defs.response.review_response import (
|
from frigate.api.defs.response.review_response import (
|
||||||
ReviewActivityMotionResponse,
|
ReviewActivityMotionResponse,
|
||||||
ReviewSegmentResponse,
|
ReviewSegmentResponse,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user