fixed circular import

This commit is contained in:
dekzter 2026-02-13 11:48:59 -05:00
parent fe9854c522
commit 3b0a890e94
2 changed files with 15 additions and 16 deletions

View file

@ -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 = [

View file

@ -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: