From d18b6a0dea354d59fd3bc24a4e24ddfe23a37673 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:19:13 -0600 Subject: [PATCH] fix formatting due to new version of ruff --- frigate/api/classification.py | 6 +++--- .../data_processing/real_time/custom_classification.py | 2 +- frigate/data_processing/real_time/face.py | 2 +- frigate/log.py | 9 +++++---- frigate/record/maintainer.py | 6 ++++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/frigate/api/classification.py b/frigate/api/classification.py index ed1e7b317..5e1087d17 100644 --- a/frigate/api/classification.py +++ b/frigate/api/classification.py @@ -73,7 +73,7 @@ def get_faces(): face_dict[name] = [] for file in filter( - lambda f: (f.lower().endswith((".webp", ".png", ".jpg", ".jpeg"))), + lambda f: f.lower().endswith((".webp", ".png", ".jpg", ".jpeg")), os.listdir(face_dir), ): face_dict[name].append(file) @@ -582,7 +582,7 @@ def get_classification_dataset(name: str): dataset_dict[category_name] = [] for file in filter( - lambda f: (f.lower().endswith((".webp", ".png", ".jpg", ".jpeg"))), + lambda f: f.lower().endswith((".webp", ".png", ".jpg", ".jpeg")), os.listdir(category_dir), ): dataset_dict[category_name].append(file) @@ -693,7 +693,7 @@ def get_classification_images(name: str): status_code=200, content=list( filter( - lambda f: (f.lower().endswith((".webp", ".png", ".jpg", ".jpeg"))), + lambda f: f.lower().endswith((".webp", ".png", ".jpg", ".jpeg")), os.listdir(train_dir), ) ), diff --git a/frigate/data_processing/real_time/custom_classification.py b/frigate/data_processing/real_time/custom_classification.py index 5a58cf122..53a898de3 100644 --- a/frigate/data_processing/real_time/custom_classification.py +++ b/frigate/data_processing/real_time/custom_classification.py @@ -695,7 +695,7 @@ def write_classification_attempt( # delete oldest face image if maximum is reached try: files = sorted( - filter(lambda f: (f.endswith(".webp")), os.listdir(folder)), + filter(lambda f: f.endswith(".webp"), os.listdir(folder)), key=lambda f: os.path.getctime(os.path.join(folder, f)), reverse=True, ) diff --git a/frigate/data_processing/real_time/face.py b/frigate/data_processing/real_time/face.py index 1901a81e1..e1c11bf11 100644 --- a/frigate/data_processing/real_time/face.py +++ b/frigate/data_processing/real_time/face.py @@ -539,7 +539,7 @@ class FaceRealTimeProcessor(RealTimeProcessorApi): cv2.imwrite(file, frame) files = sorted( - filter(lambda f: (f.endswith(".webp")), os.listdir(folder)), + filter(lambda f: f.endswith(".webp"), os.listdir(folder)), key=lambda f: os.path.getctime(os.path.join(folder, f)), reverse=True, ) diff --git a/frigate/log.py b/frigate/log.py index 5cec0e0d8..cd475a4bd 100644 --- a/frigate/log.py +++ b/frigate/log.py @@ -26,15 +26,16 @@ LOG_HANDLER.setFormatter( # filter out norfair warning LOG_HANDLER.addFilter( - lambda record: not record.getMessage().startswith( - "You are using a scalar distance function" + lambda record: ( + not record.getMessage().startswith("You are using a scalar distance function") ) ) # filter out tflite logging LOG_HANDLER.addFilter( - lambda record: "Created TensorFlow Lite XNNPACK delegate for CPU." - not in record.getMessage() + lambda record: ( + "Created TensorFlow Lite XNNPACK delegate for CPU." not in record.getMessage() + ) ) diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 25c9d2cff..a90d1edc1 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -208,8 +208,10 @@ class RecordingMaintainer(threading.Thread): processed_segment_count = len( list( filter( - lambda r: r["start_time"].timestamp() - < most_recently_processed_frame_time, + lambda r: ( + r["start_time"].timestamp() + < most_recently_processed_frame_time + ), grouped_recordings[camera], ) )