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

Liquidsoap interface for fallbacks. #43

parent b02e032e
No related branches found
No related tags found
No related merge requests found
......@@ -116,10 +116,10 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
#
# Playlist
# Queues
#
def playlist_push(self, channel, uri):
def queue_push(self, channel, uri):
"""
Pushes the passed file URI to the `equeue` playlist channel.
......@@ -131,7 +131,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
return self.message
def playlist_seek(self, channel, duration):
def queue_seek(self, channel, duration):
"""
Forward the playing `equeue` track/playlist of the given channel.
......@@ -146,7 +146,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
return self.message
def playlist_clear(self, channel):
def queue_clear(self, channel):
"""
Clears all `equeue` playlist entries of the given channel.
......@@ -157,19 +157,36 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
Returns:
Liquidsoap server response
"""
if channel == Channel.FILESYSTEM_A.value:
self.command(channel, 'clear')
elif channel == Channel.FILESYSTEM_B.value:
self.command(channel, 'clear')
self.command(channel, 'clear')
return self.message
#
# Playlist
#
def playlist_uri_set(self, channel, uri):
"""
Sets the URI of a playlist source.
Args:
channel (String): Liquidsoap Source ID
uri (String): URI to the playlist file
Returns:
Liquidsoap server response
"""
if channel == Channel.SCHEDULED_FALLBACK.value:
self.command(channel, 'uri', uri)
else:
return "Invalid filesystem channel '%s'" % channel
return self.message
def playlist_uri(self, channel, uri):
def playlist_uri_clear(self, channel):
"""
Sets the URI of a playlist source.
Clears the URI of a playlist source.
Args:
channel (String): Liquidsoap Source ID
......@@ -179,7 +196,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
Liquidsoap server response
"""
if channel == Channel.SCHEDULED_FALLBACK.value:
self.command(channel, 'uri', uri)
self.command(channel, 'clear')
else:
return "Invalid filesystem channel '%s'" % channel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment