diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index 1dcc8405d..d28166a7b 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -325,6 +325,12 @@ class PtzAutoTracker: def _write_config(self, camera): config_file = os.environ.get("CONFIG_FILE", f"{CONFIG_DIR}/config.yml") + # Check if we can use .yaml instead of .yml + config_file_yaml = config_file.replace(".yml", ".yaml") + + if os.path.isfile(config_file_yaml): + config_file = config_file_yaml + logger.debug( f"{camera}: Writing new config with autotracker motion coefficients: {self.config.cameras[camera].onvif.autotracking.movement_weights}" ) diff --git a/frigate/util/builtin.py b/frigate/util/builtin.py index 164c34091..8da0e9283 100644 --- a/frigate/util/builtin.py +++ b/frigate/util/builtin.py @@ -198,12 +198,23 @@ def update_yaml_from_url(file_path, url): def update_yaml_file(file_path, key_path, new_value): yaml = YAML() yaml.indent(mapping=2, sequence=4, offset=2) - with open(file_path, "r") as f: - data = yaml.load(f) + + try: + with open(file_path, "r") as f: + data = yaml.load(f) + except FileNotFoundError: + logger.error( + f"Unable to read from Frigate config file {file_path}. Make sure it exists and is readable." + ) + return data = update_yaml(data, key_path, new_value) - with open(file_path, "w") as f: - yaml.dump(data, f) + + try: + with open(file_path, "w") as f: + yaml.dump(data, f) + except Exception as e: + logger.error(f"Unable to write to Frigate config file {file_path}: {e}") def update_yaml(data, key_path, new_value): diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx index fd8096ebc..a39ae5af0 100644 --- a/web/src/components/card/AnimatedEventCard.tsx +++ b/web/src/components/card/AnimatedEventCard.tsx @@ -109,7 +109,7 @@ export function AnimatedEventCard({
setIsHovered(true) : undefined} onMouseLeave={isDesktop ? () => setIsHovered(false) : undefined} diff --git a/web/src/components/overlay/detail/ObjectLifecycle.tsx b/web/src/components/overlay/detail/ObjectLifecycle.tsx index 3c642c12b..c2da8ec36 100644 --- a/web/src/components/overlay/detail/ObjectLifecycle.tsx +++ b/web/src/components/overlay/detail/ObjectLifecycle.tsx @@ -334,7 +334,9 @@ export default function ObjectLifecycle({ /> - Adjust annotation settings + + Adjust annotation settings +
diff --git a/web/src/views/explore/ExploreView.tsx b/web/src/views/explore/ExploreView.tsx index f3fb330b0..8fd75ae49 100644 --- a/web/src/views/explore/ExploreView.tsx +++ b/web/src/views/explore/ExploreView.tsx @@ -35,7 +35,12 @@ export default function ExploreView({ // data - const { data: events, mutate } = useSWR( + const { + data: events, + mutate, + isLoading, + isValidating, + } = useSWR( [ "events/explore", { @@ -81,7 +86,7 @@ export default function ExploreView({ } }, [events, searchDetail, setSearchDetail]); - if (!events) { + if (isLoading) { return ( ); @@ -93,6 +98,7 @@ export default function ExploreView({ @@ -104,12 +110,14 @@ export default function ExploreView({ type ThumbnailRowType = { objectType: string; searchResults?: SearchResult[]; + isValidating: boolean; setSearchDetail: (search: SearchResult | undefined) => void; }; function ThumbnailRow({ objectType, searchResults, + isValidating, setSearchDetail, }: ThumbnailRowType) { const navigate = useNavigate(); @@ -123,7 +131,7 @@ function ThumbnailRow({ return (
-
+
{objectType.replaceAll("_", " ")} {searchResults && ( @@ -135,6 +143,7 @@ function ThumbnailRow({ tracked objects){" "} )} + {isValidating && }
{searchResults?.map((event) => (