Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear plus id of submitted events #8729

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/docs/integrations/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ Permanently deletes the event along with any clips/snapshots.

Sets retain to true for the event id.

### `DELETE /api/events/<id>/plus`

Clears the submit flag of an event that was previously submitted to Frigate+. Useful when an event was submitted as a false positive while being a positive, or vice versa. Also make sure to delete the image in Frigate+ accordingly!

### `POST /api/events/<id>/plus`

Submits the snapshot of the event to Frigate+ for labeling.
Expand Down
17 changes: 17 additions & 0 deletions frigate/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,23 @@ def set_retain(id):
)


@bp.route("/events/<id>/plus", methods=("DELETE",))
def clear_plus(id):
try:
event = Event.get(Event.id == id)
except DoesNotExist:
return make_response(
jsonify({"success": False, "message": "Event " + id + " not found"}), 404
)

event.plus_id = None
event.save()

return make_response(
jsonify({"success": True, "message": "Event " + id + " plus_id cleared"}), 200
)


@bp.route("/events/<id>/plus", methods=("POST",))
def send_to_plus(id):
if not current_app.plus_api.is_active():
Expand Down