mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-14 09:06:43 +03:00
Replace stringy paths with constants (#21247)
This commit is contained in:
parent
649ca49e55
commit
67e18eff94
@ -21,7 +21,7 @@ from frigate.config.camera.updater import (
|
|||||||
CameraConfigUpdateEnum,
|
CameraConfigUpdateEnum,
|
||||||
CameraConfigUpdateSubscriber,
|
CameraConfigUpdateSubscriber,
|
||||||
)
|
)
|
||||||
from frigate.const import CONFIG_DIR
|
from frigate.const import BASE_DIR, CONFIG_DIR
|
||||||
from frigate.models import User
|
from frigate.models import User
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -371,7 +371,7 @@ class WebPushClient(Communicator):
|
|||||||
|
|
||||||
sorted_objects.update(payload["after"]["data"]["sub_labels"])
|
sorted_objects.update(payload["after"]["data"]["sub_labels"])
|
||||||
|
|
||||||
image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}"
|
image = f"{payload['after']['thumb_path'].replace(BASE_DIR, '')}"
|
||||||
ended = state == "end" or state == "genai"
|
ended = state == "end" or state == "genai"
|
||||||
|
|
||||||
if state == "genai" and payload["after"]["data"]["metadata"]:
|
if state == "genai" and payload["after"]["data"]["metadata"]:
|
||||||
|
|||||||
@ -14,6 +14,7 @@ from setproctitle import setproctitle
|
|||||||
|
|
||||||
import frigate.log
|
import frigate.log
|
||||||
from frigate.config.logger import LoggerConfig
|
from frigate.config.logger import LoggerConfig
|
||||||
|
from frigate.const import CONFIG_DIR
|
||||||
|
|
||||||
|
|
||||||
class BaseProcess(mp.Process):
|
class BaseProcess(mp.Process):
|
||||||
@ -92,7 +93,7 @@ class FrigateProcess(BaseProcess):
|
|||||||
try:
|
try:
|
||||||
import memray
|
import memray
|
||||||
|
|
||||||
reports_dir = pathlib.Path("/config/memray_reports")
|
reports_dir = pathlib.Path(CONFIG_DIR) / "memray_reports"
|
||||||
reports_dir.mkdir(parents=True, exist_ok=True)
|
reports_dir.mkdir(parents=True, exist_ok=True)
|
||||||
safe_name = (
|
safe_name = (
|
||||||
process_name.replace(":", "_").replace("/", "_").replace("\\", "_")
|
process_name.replace(":", "_").replace("/", "_").replace("\\", "_")
|
||||||
@ -126,7 +127,7 @@ class FrigateProcess(BaseProcess):
|
|||||||
self.__memray_tracker.__exit__(None, None, None)
|
self.__memray_tracker.__exit__(None, None, None)
|
||||||
self.__memray_tracker = None
|
self.__memray_tracker = None
|
||||||
|
|
||||||
reports_dir = pathlib.Path("/config/memray_reports")
|
reports_dir = pathlib.Path(CONFIG_DIR) / "memray_reports"
|
||||||
html_file = reports_dir / f"{safe_name}.html"
|
html_file = reports_dir / f"{safe_name}.html"
|
||||||
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user