Skip to content
Snippets Groups Projects
Commit bc0ac0e4 authored by David Trattnig's avatar David Trattnig
Browse files

Utility to get playlist type by ID.

parent 499d7bd2
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ import datetime ...@@ -21,7 +21,7 @@ import datetime
import time import time
from enum import Enum from enum import Enum
from modules.base.enum import Channel, ChannelType from modules.base.enum import Channel, ChannelType, PlaylistType
...@@ -67,6 +67,28 @@ class EngineUtil: ...@@ -67,6 +67,28 @@ class EngineUtil:
@staticmethod
def get_playlist_type(id):
"""
Converts an playlist type ID to the playlist type object.
Args:
id (String): playlist type ID
Returns:
type (PlaylistType): The type
"""
if id == 0:
return PlaylistType.DEFAULT
elif id == 1:
return PlaylistType.SHOW
elif id == 2:
return PlaylistType.TIMESLOT
else:
return PlaylistType.STATION
@staticmethod @staticmethod
def get_entries_string(entries): def get_entries_string(entries):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment