From 825460244977b0833a4980d390a8ee25b63ba00e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sun, 3 Aug 2025 23:56:23 -0600 Subject: [PATCH] Fix not deleting thumbnails (#19371) * Fix not deleting thumbnails * Consoldiate langauge tags --- frigate/events/cleanup.py | 11 ++++++----- web/public/locales/{pt_BR => pt-BR}/audio.json | 0 .../locales/{pt_BR => pt-BR}/components/auth.json | 0 .../locales/{pt_BR => pt-BR}/components/icons.json | 0 .../locales/{pt_BR => pt-BR}/components/input.json | 0 web/public/locales/{pt_BR => pt-BR}/objects.json | 0 .../locales/{pt_BR => pt-BR}/views/configEditor.json | 0 web/public/locales/{pt_BR => pt-BR}/views/events.json | 0 .../locales/{pt_BR => pt-BR}/views/recording.json | 0 web/public/locales/{zh_Hant => zh-Hant}/audio.json | 0 .../locales/{zh_Hant => zh-Hant}/components/auth.json | 0 .../{zh_Hant => zh-Hant}/components/icons.json | 0 .../{zh_Hant => zh-Hant}/components/input.json | 0 web/public/locales/{zh_Hant => zh-Hant}/objects.json | 0 .../{zh_Hant => zh-Hant}/views/configEditor.json | 0 .../locales/{zh_Hant => zh-Hant}/views/events.json | 0 .../locales/{zh_Hant => zh-Hant}/views/recording.json | 0 17 files changed, 6 insertions(+), 5 deletions(-) rename web/public/locales/{pt_BR => pt-BR}/audio.json (100%) rename web/public/locales/{pt_BR => pt-BR}/components/auth.json (100%) rename web/public/locales/{pt_BR => pt-BR}/components/icons.json (100%) rename web/public/locales/{pt_BR => pt-BR}/components/input.json (100%) rename web/public/locales/{pt_BR => pt-BR}/objects.json (100%) rename web/public/locales/{pt_BR => pt-BR}/views/configEditor.json (100%) rename web/public/locales/{pt_BR => pt-BR}/views/events.json (100%) rename web/public/locales/{pt_BR => pt-BR}/views/recording.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/audio.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/components/auth.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/components/icons.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/components/input.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/objects.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/views/configEditor.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/views/events.json (100%) rename web/public/locales/{zh_Hant => zh-Hant}/views/recording.json (100%) diff --git a/frigate/events/cleanup.py b/frigate/events/cleanup.py index fde27aa0f..1e97ca14c 100644 --- a/frigate/events/cleanup.py +++ b/frigate/events/cleanup.py @@ -340,21 +340,22 @@ class EventCleanup(threading.Thread): .where(Event.has_clip == False, Event.has_snapshot == False) .iterator() ) - events_to_delete = [e.id for e in events] + events_to_delete: list[Event] = [e for e in events] - for e in events: + for e in events_to_delete: delete_event_thumbnail(e) logger.debug(f"Found {len(events_to_delete)} events that can be expired") if len(events_to_delete) > 0: - for i in range(0, len(events_to_delete), CHUNK_SIZE): - chunk = events_to_delete[i : i + CHUNK_SIZE] + ids_to_delete = [e.id for e in events_to_delete] + for i in range(0, len(ids_to_delete), CHUNK_SIZE): + chunk = ids_to_delete[i : i + CHUNK_SIZE] logger.debug(f"Deleting {len(chunk)} events from the database") Event.delete().where(Event.id << chunk).execute() if self.config.semantic_search.enabled: self.db.delete_embeddings_description(event_ids=chunk) self.db.delete_embeddings_thumbnail(event_ids=chunk) - logger.debug(f"Deleted {len(events_to_delete)} embeddings") + logger.debug(f"Deleted {len(ids_to_delete)} embeddings") logger.info("Exiting event cleanup...") diff --git a/web/public/locales/pt_BR/audio.json b/web/public/locales/pt-BR/audio.json similarity index 100% rename from web/public/locales/pt_BR/audio.json rename to web/public/locales/pt-BR/audio.json diff --git a/web/public/locales/pt_BR/components/auth.json b/web/public/locales/pt-BR/components/auth.json similarity index 100% rename from web/public/locales/pt_BR/components/auth.json rename to web/public/locales/pt-BR/components/auth.json diff --git a/web/public/locales/pt_BR/components/icons.json b/web/public/locales/pt-BR/components/icons.json similarity index 100% rename from web/public/locales/pt_BR/components/icons.json rename to web/public/locales/pt-BR/components/icons.json diff --git a/web/public/locales/pt_BR/components/input.json b/web/public/locales/pt-BR/components/input.json similarity index 100% rename from web/public/locales/pt_BR/components/input.json rename to web/public/locales/pt-BR/components/input.json diff --git a/web/public/locales/pt_BR/objects.json b/web/public/locales/pt-BR/objects.json similarity index 100% rename from web/public/locales/pt_BR/objects.json rename to web/public/locales/pt-BR/objects.json diff --git a/web/public/locales/pt_BR/views/configEditor.json b/web/public/locales/pt-BR/views/configEditor.json similarity index 100% rename from web/public/locales/pt_BR/views/configEditor.json rename to web/public/locales/pt-BR/views/configEditor.json diff --git a/web/public/locales/pt_BR/views/events.json b/web/public/locales/pt-BR/views/events.json similarity index 100% rename from web/public/locales/pt_BR/views/events.json rename to web/public/locales/pt-BR/views/events.json diff --git a/web/public/locales/pt_BR/views/recording.json b/web/public/locales/pt-BR/views/recording.json similarity index 100% rename from web/public/locales/pt_BR/views/recording.json rename to web/public/locales/pt-BR/views/recording.json diff --git a/web/public/locales/zh_Hant/audio.json b/web/public/locales/zh-Hant/audio.json similarity index 100% rename from web/public/locales/zh_Hant/audio.json rename to web/public/locales/zh-Hant/audio.json diff --git a/web/public/locales/zh_Hant/components/auth.json b/web/public/locales/zh-Hant/components/auth.json similarity index 100% rename from web/public/locales/zh_Hant/components/auth.json rename to web/public/locales/zh-Hant/components/auth.json diff --git a/web/public/locales/zh_Hant/components/icons.json b/web/public/locales/zh-Hant/components/icons.json similarity index 100% rename from web/public/locales/zh_Hant/components/icons.json rename to web/public/locales/zh-Hant/components/icons.json diff --git a/web/public/locales/zh_Hant/components/input.json b/web/public/locales/zh-Hant/components/input.json similarity index 100% rename from web/public/locales/zh_Hant/components/input.json rename to web/public/locales/zh-Hant/components/input.json diff --git a/web/public/locales/zh_Hant/objects.json b/web/public/locales/zh-Hant/objects.json similarity index 100% rename from web/public/locales/zh_Hant/objects.json rename to web/public/locales/zh-Hant/objects.json diff --git a/web/public/locales/zh_Hant/views/configEditor.json b/web/public/locales/zh-Hant/views/configEditor.json similarity index 100% rename from web/public/locales/zh_Hant/views/configEditor.json rename to web/public/locales/zh-Hant/views/configEditor.json diff --git a/web/public/locales/zh_Hant/views/events.json b/web/public/locales/zh-Hant/views/events.json similarity index 100% rename from web/public/locales/zh_Hant/views/events.json rename to web/public/locales/zh-Hant/views/events.json diff --git a/web/public/locales/zh_Hant/views/recording.json b/web/public/locales/zh-Hant/views/recording.json similarity index 100% rename from web/public/locales/zh_Hant/views/recording.json rename to web/public/locales/zh-Hant/views/recording.json