mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-21 12:36:42 +03:00
Compare commits
1 Commits
31b686f700
...
7edc36dbd4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7edc36dbd4 |
@ -132,15 +132,17 @@ class ReviewDescriptionProcessor(PostProcessorApi):
|
|||||||
|
|
||||||
if image_source == ImageSourceEnum.recordings:
|
if image_source == ImageSourceEnum.recordings:
|
||||||
duration = final_data["end_time"] - final_data["start_time"]
|
duration = final_data["end_time"] - final_data["start_time"]
|
||||||
buffer_extension = min(5, duration * RECORDING_BUFFER_EXTENSION_PERCENT)
|
buffer_extension = min(
|
||||||
|
10, max(2, duration * RECORDING_BUFFER_EXTENSION_PERCENT)
|
||||||
|
)
|
||||||
|
|
||||||
# Ensure minimum total duration for short review items
|
# Ensure minimum total duration for short review items
|
||||||
# This provides better context for brief events
|
# This provides better context for brief events
|
||||||
total_duration = duration + (2 * buffer_extension)
|
total_duration = duration + (2 * buffer_extension)
|
||||||
if total_duration < MIN_RECORDING_DURATION:
|
if total_duration < MIN_RECORDING_DURATION:
|
||||||
# Expand buffer to reach minimum duration, still respecting max of 5s per side
|
# Expand buffer to reach minimum duration, still respecting max of 10s per side
|
||||||
additional_buffer_per_side = (MIN_RECORDING_DURATION - duration) / 2
|
additional_buffer_per_side = (MIN_RECORDING_DURATION - duration) / 2
|
||||||
buffer_extension = min(5, additional_buffer_per_side)
|
buffer_extension = min(10, additional_buffer_per_side)
|
||||||
|
|
||||||
thumbs = self.get_recording_frames(
|
thumbs = self.get_recording_frames(
|
||||||
camera,
|
camera,
|
||||||
|
|||||||
@ -44,16 +44,11 @@ self.addEventListener("notificationclick", (event) => {
|
|||||||
switch (event.action ?? "default") {
|
switch (event.action ?? "default") {
|
||||||
case "markReviewed":
|
case "markReviewed":
|
||||||
if (event.notification.data) {
|
if (event.notification.data) {
|
||||||
event.waitUntil(
|
fetch("/api/reviews/viewed", {
|
||||||
fetch("/api/reviews/viewed", {
|
method: "POST",
|
||||||
method: "POST",
|
headers: { "Content-Type": "application/json", "X-CSRF-TOKEN": 1 },
|
||||||
headers: {
|
body: JSON.stringify({ ids: [event.notification.data.id] }),
|
||||||
"Content-Type": "application/json",
|
});
|
||||||
"X-CSRF-TOKEN": 1,
|
|
||||||
},
|
|
||||||
body: JSON.stringify({ ids: [event.notification.data.id] }),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -63,7 +58,7 @@ self.addEventListener("notificationclick", (event) => {
|
|||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
if (clients.openWindow) {
|
if (clients.openWindow) {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
event.waitUntil(clients.openWindow(url));
|
return clients.openWindow(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user