mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-17 16:50:53 +00:00
more supported events
This commit is contained in:
parent
bc72ea7310
commit
fe9854c522
3 changed files with 26 additions and 21 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
from .utils import SUPPORTED_EVENTS
|
||||
|
||||
|
||||
class Integration(models.Model):
|
||||
|
|
@ -15,13 +16,7 @@ class Integration(models.Model):
|
|||
|
||||
|
||||
class EventSubscription(models.Model):
|
||||
EVENT_CHOICES = [
|
||||
("channel_start", "Channel Started"),
|
||||
("channel_stop", "Channel Stopped"),
|
||||
("movie_added", "Movie Added"),
|
||||
("series_added", "Series Added"),
|
||||
("download_complete", "Download Complete"),
|
||||
]
|
||||
EVENT_CHOICES = list(SUPPORTED_EVENTS.items())
|
||||
event = models.CharField(max_length=100, choices=EVENT_CHOICES)
|
||||
integration = models.ForeignKey(Integration, on_delete=models.CASCADE, related_name="subscriptions")
|
||||
enabled = models.BooleanField(default=True)
|
||||
|
|
|
|||
|
|
@ -13,20 +13,20 @@ HANDLERS = {
|
|||
"script": ScriptHandler,
|
||||
}
|
||||
|
||||
SUPPORTED_EVENTS = [
|
||||
"channel_start",
|
||||
"channel_stop",
|
||||
"channel_reconnect",
|
||||
"channel_error",
|
||||
"channel_failover",
|
||||
"stream_switch",
|
||||
"recording_start",
|
||||
"recording_end",
|
||||
"epg_refresh",
|
||||
"m3u_refresh",
|
||||
"client_connect",
|
||||
"client_disconnect",
|
||||
]
|
||||
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):
|
||||
|
|
|
|||
|
|
@ -358,4 +358,14 @@ export const CONTAINER_EXTENSIONS = [
|
|||
export const SUBSCRIPTION_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',
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue