mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 17:12:16 +03:00
Fixes (#18795)
* Catch error when regex is invalid * Fix i18n label * Mobile camera drawer i18n fixes * additional frame cache debug logs * Add Romanian * Fix exports thumbnail path * Improve clip buffer and remove outdated comments --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
co-authored by
Josh Hawkins
parent
4ff81d5877
commit
8a9ebe9292
@@ -1500,18 +1500,24 @@ class LicensePlateProcessingMixin:
|
||||
|
||||
# Determine subLabel based on known plates, use regex matching
|
||||
# Default to the detected plate, use label name if there's a match
|
||||
sub_label = next(
|
||||
(
|
||||
label
|
||||
for label, plates in self.lpr_config.known_plates.items()
|
||||
if any(
|
||||
re.match(f"^{plate}$", top_plate)
|
||||
or distance(plate, top_plate) <= self.lpr_config.match_distance
|
||||
for plate in plates
|
||||
)
|
||||
),
|
||||
None,
|
||||
)
|
||||
try:
|
||||
sub_label = next(
|
||||
(
|
||||
label
|
||||
for label, plates in self.lpr_config.known_plates.items()
|
||||
if any(
|
||||
re.match(f"^{plate}$", top_plate)
|
||||
or distance(plate, top_plate) <= self.lpr_config.match_distance
|
||||
for plate in plates
|
||||
)
|
||||
),
|
||||
None,
|
||||
)
|
||||
except re.error:
|
||||
logger.error(
|
||||
f"{camera}: Invalid regex in known plates configuration: {self.lpr_config.known_plates}"
|
||||
)
|
||||
sub_label = None
|
||||
|
||||
# If it's a known plate, publish to sub_label
|
||||
if sub_label is not None:
|
||||
|
||||
Reference in New Issue
Block a user