mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 19:17:41 +03:00
use titlecase for better python capitalization
the built in .title() method isn't great because it capitalizes letters after apostrophes, so it would look like "Josh'S"
This commit is contained in:
parent
2a6c73d35f
commit
6b3e074785
@ -264,6 +264,7 @@ tensorrt
|
|||||||
tflite
|
tflite
|
||||||
thresholded
|
thresholded
|
||||||
timelapse
|
timelapse
|
||||||
|
titlecase
|
||||||
tmpfs
|
tmpfs
|
||||||
tobytes
|
tobytes
|
||||||
toggleable
|
toggleable
|
||||||
|
|||||||
@ -31,6 +31,7 @@ norfair == 2.2.*
|
|||||||
setproctitle == 1.3.*
|
setproctitle == 1.3.*
|
||||||
ws4py == 0.5.*
|
ws4py == 0.5.*
|
||||||
unidecode == 1.3.*
|
unidecode == 1.3.*
|
||||||
|
titlecase == 2.4.*
|
||||||
# Image Manipulation
|
# Image Manipulation
|
||||||
numpy == 1.26.*
|
numpy == 1.26.*
|
||||||
opencv-python-headless == 4.11.0.*
|
opencv-python-headless == 4.11.0.*
|
||||||
|
|||||||
@ -12,6 +12,7 @@ from typing import Any, Callable
|
|||||||
|
|
||||||
from py_vapid import Vapid01
|
from py_vapid import Vapid01
|
||||||
from pywebpush import WebPusher
|
from pywebpush import WebPusher
|
||||||
|
from titlecase import titlecase
|
||||||
|
|
||||||
from frigate.comms.base_communicator import Communicator
|
from frigate.comms.base_communicator import Communicator
|
||||||
from frigate.comms.config_updater import ConfigSubscriber
|
from frigate.comms.config_updater import ConfigSubscriber
|
||||||
@ -325,8 +326,8 @@ class WebPushClient(Communicator): # type: ignore[misc]
|
|||||||
|
|
||||||
sorted_objects.update(payload["after"]["data"]["sub_labels"])
|
sorted_objects.update(payload["after"]["data"]["sub_labels"])
|
||||||
|
|
||||||
title = f"{', '.join(sorted_objects).replace('_', ' ').title()}{' was' if state == 'end' else ''} detected in {', '.join(payload['after']['data']['zones']).replace('_', ' ').title()}"
|
title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {titlecase(', '.join(payload['after']['data']['zones']).replace('_', ' '))}"
|
||||||
message = f"Detected on {camera.replace('_', ' ').title()}"
|
message = f"Detected on {titlecase(camera.replace('_', ' '))}"
|
||||||
image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}"
|
image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}"
|
||||||
|
|
||||||
# if event is ongoing open to live view otherwise open to recordings view
|
# if event is ongoing open to live view otherwise open to recordings view
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user