mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-22 05:23:01 +03:00
Fix camera name prefix matching (#24992)
* only remove the deleted camera's media files
Camera deletion globbed snapshot, clean copy, and review thumbnail files by "{camera}-*", and camera names can contain "-", so deleting "front" also removed every one of those files for "front-door". Files are now matched on the full name, the camera followed by an event or review id.
* only use the camera's own preview frames for review descriptions
get_cache_frames matched cached preview frames by "preview_{camera}-", so when "front" had no frame after the review ended, the first "front-door" frame became the trailing frame and went into front's GenAI prompt. It now uses is_camera_preview_frame like the preview recorder and exports.
* keep cleaning up when a media directory can't be listed
This commit is contained in:
@@ -35,6 +35,7 @@ from frigate.data_processing.types import PostProcessDataEnum
|
||||
from frigate.genai import GenAIClient
|
||||
from frigate.genai.manager import GenAIClientManager
|
||||
from frigate.models import Event, Recordings, ReviewSegment
|
||||
from frigate.output.preview import is_camera_preview_frame
|
||||
from frigate.util.builtin import EventsPerSecond, InferenceSpeed
|
||||
from frigate.util.image import get_image_from_recording
|
||||
from frigate.util.recording_coverage import recording_overlap
|
||||
@@ -528,7 +529,7 @@ class ReviewDescriptionProcessor(PostProcessorApi):
|
||||
camera_files = [
|
||||
entry.name
|
||||
for entry in os.scandir(preview_dir)
|
||||
if entry.name.startswith(file_start)
|
||||
if is_camera_preview_frame(entry.name, camera)
|
||||
]
|
||||
camera_files.sort()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user