mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-25 21:29:01 +03:00
Fixes (#18304)
* fix recordings check * Only calculate inpoint offset for beginning of hour segment * Cleanup * Fix seeking * add Czech * explore i18n fix --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
co-authored by
Nicolas Mowen
parent
717517aeb5
commit
8a143b4284
@@ -0,0 +1,26 @@
|
||||
import { Recording } from "@/types/record";
|
||||
|
||||
/** the HLS endpoint returns the vod segments with the first
|
||||
* segment of the hour trimmed, meaning it will start at
|
||||
* the beginning of the hour, cutting off any difference
|
||||
* that the segment has.
|
||||
*/
|
||||
export function calculateInpointOffset(
|
||||
timeRangeStart: number | undefined,
|
||||
firstRecordingSegment: Recording | undefined,
|
||||
): number {
|
||||
if (!timeRangeStart || !firstRecordingSegment) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if the first recording segment does not cross over
|
||||
// the beginning of the time range then there is no offset
|
||||
if (
|
||||
firstRecordingSegment.start_time < timeRangeStart &&
|
||||
firstRecordingSegment.end_time > timeRangeStart
|
||||
) {
|
||||
return timeRangeStart - firstRecordingSegment.start_time;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user