From ea703434b36e4feccc8928b7a182eab35d70da0f Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Mon, 8 Jun 2020 13:05:21 +0200
Subject: [PATCH] PlaylistType mapping.

---
 modules/base/enum.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/base/enum.py b/modules/base/enum.py
index a35c16b7..2a655aee 100644
--- a/modules/base/enum.py
+++ b/modules/base/enum.py
@@ -102,11 +102,18 @@ class TransitionType(Enum):
     FADE = "fade"
 
 
-class FallbackType(Enum):
-    SHOW = "show" # the first played when the show playlist fails
-    TIMESLOT = "timeslot" # the second played when timeslot fallback fails
-    STATION = "station" # the last played when everything else fails
+class PlaylistType(Enum):
+    DEFAULT     = { "id": 0, "name": "default" }    # Default play mode
+    SHOW        = { "id": 1, "name": "show" }       # The first played when some default playlist fails
+    TIMESLOT    = { "id": 2, "name": "timeslot" }   # The second played when the timeslot fallback fails
+    STATION     = { "id": 3, "name": "station" }    # The last played when everything else fails
 
+    @property
+    def id(self):
+        return self.value["id"]
+
+    def __str__(self):
+        return str(self.value["name"])
 
 
 class TimerType(Enum):
-- 
GitLab