From 3b0a890e947a795b8bc40177517d87f375cf1738 Mon Sep 17 00:00:00 2001 From: dekzter Date: Fri, 13 Feb 2026 11:48:59 -0500 Subject: [PATCH] fixed circular import --- apps/connect/models.py | 14 ++++++++++++++ apps/connect/utils.py | 17 +---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/apps/connect/models.py b/apps/connect/models.py index ba489eb2..36419930 100644 --- a/apps/connect/models.py +++ b/apps/connect/models.py @@ -1,6 +1,20 @@ from django.db import models from .utils import SUPPORTED_EVENTS +SUPPORTED_EVENTS = { + "channel_start": "Channel Started", + "channel_stop": "Channel Stopped", + "channel_reconnect": "Channel Reconnected", + "channel_error": "Channel Error", + "channel_failover": "Channel Failover", + "stream_switch": "Stream Switch", + "recording_start": "Recording Started", + "recording_end": "Recording Ended", + "epg_refresh": "EPG Refreshed", + "m3u_refresh": "M3U Refreshed", + "client_connect": "Client Connected", + "client_disconnect": "Client Disconnected", +} class Integration(models.Model): TYPE_CHOICES = [ diff --git a/apps/connect/utils.py b/apps/connect/utils.py index 407a3707..6144a6b3 100644 --- a/apps/connect/utils.py +++ b/apps/connect/utils.py @@ -1,7 +1,7 @@ # connect/utils.py import logging, json from django.template import Template, Context -from .models import EventSubscription, DeliveryLog +from .models import EventSubscription, DeliveryLog, SUPPORTED_EVENTS from .handlers.webhook import WebhookHandler from .handlers.script import ScriptHandler from apps.plugins.loader import PluginManager @@ -13,21 +13,6 @@ HANDLERS = { "script": ScriptHandler, } -SUPPORTED_EVENTS = { - "channel_start": "Channel Started", - "channel_stop": "Channel Stopped", - "channel_reconnect": "Channel Reconnected", - "channel_error": "Channel Error", - "channel_failover": "Channel Failover", - "stream_switch": "Stream Switch", - "recording_start": "Recording Started", - "recording_end": "Recording Ended", - "epg_refresh": "EPG Refreshed", - "m3u_refresh": "M3U Refreshed", - "client_connect": "Client Connected", - "client_disconnect": "Client Disconnected", -} - def trigger_event(event_name, payload): if event_name not in SUPPORTED_EVENTS: