mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-03 22:04:53 +03:00
Clamp future timestamps to now
This commit is contained in:
parent
99fa5e1dee
commit
8381c12920
@ -26,6 +26,7 @@ export function parseRecordingReviewLink(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const parsedTimestamp = Number(timestamp);
|
const parsedTimestamp = Number(timestamp);
|
||||||
|
const now = Math.floor(Date.now() / 1000);
|
||||||
|
|
||||||
if (!Number.isFinite(parsedTimestamp) || parsedTimestamp <= 0) {
|
if (!Number.isFinite(parsedTimestamp) || parsedTimestamp <= 0) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -33,7 +34,8 @@ export function parseRecordingReviewLink(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
camera,
|
camera,
|
||||||
timestamp: Math.floor(parsedTimestamp),
|
// clamp future timestamps to now
|
||||||
|
timestamp: Math.min(Math.floor(parsedTimestamp), now),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user