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

Liquidsoap interface for fallbacks. #43

parent 83c669c2
No related branches found
No related tags found
No related merge requests found
...@@ -116,10 +116,10 @@ class LiquidSoapPlayerClient(LiquidSoapClient): ...@@ -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. Pushes the passed file URI to the `equeue` playlist channel.
...@@ -131,7 +131,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient): ...@@ -131,7 +131,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
return self.message 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. Forward the playing `equeue` track/playlist of the given channel.
...@@ -146,7 +146,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient): ...@@ -146,7 +146,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
return self.message return self.message
def playlist_clear(self, channel): def queue_clear(self, channel):
""" """
Clears all `equeue` playlist entries of the given channel. Clears all `equeue` playlist entries of the given channel.
...@@ -157,19 +157,36 @@ class LiquidSoapPlayerClient(LiquidSoapClient): ...@@ -157,19 +157,36 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
Returns: Returns:
Liquidsoap server response Liquidsoap server response
""" """
if channel == Channel.FILESYSTEM_A.value: self.command(channel, 'clear')
self.command(channel, 'clear') return self.message
elif channel == Channel.FILESYSTEM_B.value:
self.command(channel, 'clear')
#
# 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: else:
return "Invalid filesystem channel '%s'" % channel return "Invalid filesystem channel '%s'" % channel
return self.message 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: Args:
channel (String): Liquidsoap Source ID channel (String): Liquidsoap Source ID
...@@ -179,7 +196,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient): ...@@ -179,7 +196,7 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
Liquidsoap server response Liquidsoap server response
""" """
if channel == Channel.SCHEDULED_FALLBACK.value: if channel == Channel.SCHEDULED_FALLBACK.value:
self.command(channel, 'uri', uri) self.command(channel, 'clear')
else: else:
return "Invalid filesystem channel '%s'" % channel 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