Commit 4c7bf9aa authored by David Trattnig's avatar David Trattnig
Browse files

Correct assignment of live channels. #3

parent 0045a9eb
......@@ -212,7 +212,8 @@ class SoundSystem():
# LIVE
if entry.get_type() == ChannelType.LIVE:
entry.channel = "linein_" + entry.source.split("line://")[1]
channel_num = entry.source.split("line://")[1]
entry.channel = Channel["LIVE_"+channel_num]
is_ready = True
else:
# Choose and save the input channel
......@@ -303,17 +304,18 @@ class SoundSystem():
self.active_channel[entry.get_type()] = entry.channel
# Dear filesystem channels, please leave the room as you would like to find it!
if entry.previous_channel and entry.previous_channel in ChannelType.FILESYSTEM.channels:
def clean_up():
# Wait a little, if there is some long fade-out. Note, this also means,
# this channel should not be used for at least some seconds (including clearing time).
time.sleep(2)
self.enable_transaction()
self.channel_activate(entry.previous_channel.value, False)
res = self.playlist_clear(entry.previous_channel)
self.logger.info("Clear Queue Response: " + res)
self.disable_transaction()
Thread(target=clean_up).start()
if hasattr(entry, "previous_channel"):
if entry.previous_channel in ChannelType.FILESYSTEM.channels:
def clean_up():
# Wait a little, if there is some long fade-out. Note, this also means,
# this channel should not be used for at least some seconds (including clearing time).
time.sleep(2)
self.enable_transaction()
self.channel_activate(entry.previous_channel.value, False)
res = self.playlist_clear(entry.previous_channel)
self.logger.info("Clear Queue Response: " + res)
self.disable_transaction()
Thread(target=clean_up).start()
# Filesystem meta-changes trigger the event via Liquidsoap
if not entry.channel in ChannelType.FILESYSTEM.channels:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment