mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-28 14:49:01 +03:00
Fixes (#23235)
* use stable empty object reference for swr metadata default * version bump * Refactor get_min_region_size for dimension normalization Refactor get_min_region_size to normalize dimensions for smaller models and ensure minimum region size is 320 for larger models. * reject restricted go2rtc stream sources when added via api * add env var check function * fix typing --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
co-authored by
Nicolas Mowen
parent
2cfb530dbf
commit
0013555528
@@ -5,6 +5,8 @@ import { LiveStreamMetadata } from "@/types/live";
|
||||
|
||||
const FETCH_TIMEOUT_MS = 10000;
|
||||
const DEFER_DELAY_MS = 2000;
|
||||
const emptyObject: Readonly<{ [key: string]: LiveStreamMetadata }> =
|
||||
Object.freeze({});
|
||||
|
||||
/**
|
||||
* Hook that fetches go2rtc stream metadata with deferred loading.
|
||||
@@ -77,7 +79,7 @@ export default function useDeferredStreamMetadata(streamNames: string[]) {
|
||||
return metadata;
|
||||
}, []);
|
||||
|
||||
const { data: metadata = {} } = useSWR<{
|
||||
const { data: metadata = emptyObject } = useSWR<{
|
||||
[key: string]: LiveStreamMetadata;
|
||||
}>(swrKey, fetcher, {
|
||||
revalidateOnFocus: false,
|
||||
|
||||
Reference in New Issue
Block a user