Miscellaneous Fixes (0.17 beta) (#21396)

* use fallback timeout for opening media source

covers the case where there is no active connection to the go2rtc stream and the camera takes a long time to start

* Add review thumbnail URL to integration docs

* fix weekday starting point on explore when set to monday in UI settings

* only show allowed cameras and groups in camera filter button

* Reset the wizard state after closing with model

* remove footnote about 0.17

* 0.17

* add triggers to note

* add slovak

* Ensure genai client exists

* Correctly catch JSONDecodeError

* clarify docs for none class

* version bump on updating page

* fix ExportRecordingsBody to allow optional name field

fixes https://github.com/blakeblackshear/frigate/discussions/21413 because of https://github.com/blakeblackshear/frigate-hass-integration/pull/1021

* Catch remote protocol error from ollama

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
Josh Hawkins
2025-12-24 08:03:09 -06:00
committed by GitHub
parent f862ef5d0c
commit a4ece9dae3
14 changed files with 87 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
from typing import Union
from typing import Optional, Union
from pydantic import BaseModel, Field
from pydantic.json_schema import SkipJsonSchema
@@ -16,5 +16,5 @@ class ExportRecordingsBody(BaseModel):
source: PlaybackSourceEnum = Field(
default=PlaybackSourceEnum.recordings, title="Playback source"
)
name: str = Field(title="Friendly name", default=None, max_length=256)
name: Optional[str] = Field(title="Friendly name", default=None, max_length=256)
image_path: Union[str, SkipJsonSchema[None]] = None

View File

@@ -203,7 +203,9 @@ class EmbeddingMaintainer(threading.Thread):
# post processors
self.post_processors: list[PostProcessorApi] = []
if any(c.review.genai.enabled_in_config for c in self.config.cameras.values()):
if self.genai_client is not None and any(
c.review.genai.enabled_in_config for c in self.config.cameras.values()
):
self.post_processors.append(
ReviewDescriptionProcessor(
self.config, self.requestor, self.metrics, self.genai_client
@@ -244,7 +246,9 @@ class EmbeddingMaintainer(threading.Thread):
)
self.post_processors.append(semantic_trigger_processor)
if any(c.objects.genai.enabled_in_config for c in self.config.cameras.values()):
if self.genai_client is not None and any(
c.objects.genai.enabled_in_config for c in self.config.cameras.values()
):
self.post_processors.append(
ObjectDescriptionProcessor(
self.config,

View File

@@ -3,7 +3,7 @@
import logging
from typing import Any, Optional
from httpx import TimeoutException
from httpx import RemoteProtocolError, TimeoutException
from ollama import Client as ApiClient
from ollama import ResponseError
@@ -68,7 +68,12 @@ class OllamaClient(GenAIClient):
f"Ollama tokens used: eval_count={result.get('eval_count')}, prompt_eval_count={result.get('prompt_eval_count')}"
)
return result["response"].strip()
except (TimeoutException, ResponseError, ConnectionError) as e:
except (
TimeoutException,
ResponseError,
RemoteProtocolError,
ConnectionError,
) as e:
logger.warning("Ollama returned an error: %s", str(e))
return None

View File

@@ -42,11 +42,10 @@ def get_latest_version(config: FrigateConfig) -> str:
"https://api.github.com/repos/blakeblackshear/frigate/releases/latest",
timeout=10,
)
response = request.json()
except (RequestException, JSONDecodeError):
return "unknown"
response = request.json()
if request.ok and response and "tag_name" in response:
return str(response.get("tag_name").replace("v", ""))
else: