diff --git a/docs/docs/integrations/api.md b/docs/docs/integrations/api.md index 64f427b4b..6147c36c4 100644 --- a/docs/docs/integrations/api.md +++ b/docs/docs/integrations/api.md @@ -175,7 +175,7 @@ Events from the database. Accepts the following query string parameters: | `min_length` | float | Minimum length of the event | | `max_length` | float | Maximum length of the event | | `search` | str | Search query for semantic search | -| `like` | str | Event ID for thumbnail similarity search | +| `thumb_like` | str | Event ID for thumbnail similarity search | ### `GET /api/timeline` diff --git a/frigate/http.py b/frigate/http.py index ccb059fcd..395457c45 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -1056,7 +1056,7 @@ def events(): max_length = request.args.get("max_length", type=float) search = request.args.get("search", type=str) or None search_type = request.args.get("search_type", "all") - like = request.args.get("like", type=str) or None + thumb_like = request.args.get("thumb_like", type=str) or None clauses = [] @@ -1219,10 +1219,10 @@ def events(): elif len(embeddings_filters) == 1: where = embeddings_filters[0] - if like is not None: + if thumb_like is not None: # Grab the ids of events that match the thumbnail image embeddings thumbnails: Collection = current_app.embeddings.thumbnail - search_event = Event.get(Event.id == like) + search_event = Event.get(Event.id == thumb_like) thumbnail = base64.b64decode(search_event.thumbnail) img = np.array(Image.open(io.BytesIO(thumbnail)).convert("RGB")) thumb_result: QueryResult = thumbnails.query( diff --git a/web-old/src/routes/Events.jsx b/web-old/src/routes/Events.jsx index 8d0b7af0a..7c36eda79 100644 --- a/web-old/src/routes/Events.jsx +++ b/web-old/src/routes/Events.jsx @@ -274,10 +274,10 @@ export default function Events({ path, ...props }) { if (e) { e.stopPropagation(); } - if (searchParams?.like == event_id) { + if (searchParams?.thumb_like == event_id) { return; } - onFilter('like', event_id); + onFilter('thumb_like', event_id); }; const showSubmitToPlus = (event_id, label, box, e) => { @@ -310,7 +310,7 @@ export default function Events({ path, ...props }) { (name, value) => { setShowInProgress(false); const updatedParams = { ...searchParams, [name]: value }; - if (name !== 'like') delete updatedParams['like']; + if (name !== 'thumb_like') delete updatedParams['thumb_like']; setSearchParams(updatedParams); const queryString = Object.keys(updatedParams) .map((key) => { @@ -336,7 +336,7 @@ export default function Events({ path, ...props }) { const isDone = (eventPages?.[eventPages.length - 1]?.length ?? 0) < API_LIMIT || (searchParams?.search?.length ?? 0) > 0 || - (searchParams?.like?.length ?? 0) > 0; + (searchParams?.thumb_like?.length ?? 0) > 0; // hooks for infinite scroll const observer = useRef();