From a6050d3734e55721b8aeadd5421eb500a7bab5a2 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Sat, 31 Oct 2020 20:28:55 +0100
Subject: [PATCH] Channels for station fallbacks. #38

---
 src/core/channels.py | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/core/channels.py b/src/core/channels.py
index c5184659..d251cdd4 100644
--- a/src/core/channels.py
+++ b/src/core/channels.py
@@ -32,12 +32,10 @@ class TransitionType(Enum):
 
 class Channel(Enum):
     """
-    Channel name mappings to the Liqidsoap channel IDs.
+    Channel name mappings to the Liqidsoap channel/source IDs.
     """
     QUEUE_A = "in_filesystem_0"
     QUEUE_B = "in_filesystem_1"
-    FALLBACK_QUEUE_A = "in_fallback_scheduled_0"
-    FALLBACK_QUEUE_B = "in_fallback_scheduled_1"
     HTTP_A  = "in_http_0"
     HTTP_B  = "in_http_1"
     HTTPS_A  = "in_https_0"
@@ -47,6 +45,10 @@ class Channel(Enum):
     LIVE_2 = "linein_2"
     LIVE_3 = "linein_3"
     LIVE_4 = "linein_4"
+    FALLBACK_QUEUE_A = "in_fallback_scheduled_0"
+    FALLBACK_QUEUE_B = "in_fallback_scheduled_1"    
+    FALLBACK_STATION_FOLDER = "station_folder"
+    FALLBACK_STATION_PLAYLIST = "station_playlist"
 
     def __str__(self):
         return str(self.value)
@@ -61,11 +63,6 @@ class ChannelType(Enum):
         "numeric": 0,
         "channels": [Channel.QUEUE_A, Channel.QUEUE_B]
     }
-    FALLBACK_QUEUE = {
-        "id": "fallback_queue",
-        "numeric": 0,
-        "channels": [Channel.FALLBACK_QUEUE_A, Channel.FALLBACK_QUEUE_B]
-    }
     HTTP = {
         "id": "http",
         "numeric": 1,
@@ -87,6 +84,16 @@ class ChannelType(Enum):
             Channel.LIVE_4
         ]
     }
+    FALLBACK_QUEUE = {
+        "id": "fallback_queue",
+        "numeric": 4,
+        "channels": [Channel.FALLBACK_QUEUE_A, Channel.FALLBACK_QUEUE_B]
+    }    
+    FALLBACK_POOL = {
+        "id": "fallback_pool",
+        "numeric": 5,
+        "channels": [Channel.FALLBACK_STATION_FOLDER, Channel.FALLBACK_STATION_PLAYLIST]
+    }
 
     @property
     def channels(self):
-- 
GitLab