mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-17 16:50:53 +00:00
fixed circular import
This commit is contained in:
parent
fe9854c522
commit
3b0a890e94
2 changed files with 15 additions and 16 deletions
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue