Merge branch '2.4.x' of dev.sourcefabric.org:airtime into 2.4.x
This commit is contained in:
commit
abd3a37970
3 changed files with 14 additions and 6 deletions
|
@ -404,9 +404,9 @@ function setupEventListeners() {
|
|||
content: {
|
||||
text: sprintf(
|
||||
$.i18n._("Some steam types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided."),
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/pages/viewpage.action?pageId=13632310'>",
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/x/NgPQ'>",
|
||||
"</a>",
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/display/CC/Airtime+Opus+Support'>",
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/x/KgPQ'>",
|
||||
"</a>")
|
||||
},
|
||||
hide: {
|
||||
|
|
|
@ -174,7 +174,7 @@ def liquidsoap_get_info(telnet_lock, host, port, logger):
|
|||
return get_liquidsoap_version(response)
|
||||
|
||||
def get_liquidsoap_version(version_string):
|
||||
m = re.match(r"Liquidsoap (\d+.\d+.\d+)", "Liquidsoap 1.1.1")
|
||||
m = re.match(r"Liquidsoap (\d+.\d+.\d+)", version_string)
|
||||
|
||||
if m:
|
||||
return m.group(1)
|
||||
|
|
|
@ -27,8 +27,16 @@ class TelnetLiquidsoap:
|
|||
def __connect(self):
|
||||
return telnetlib.Telnet(self.ls_host, self.ls_port)
|
||||
|
||||
def __is_empty(self, tn, queue_id):
|
||||
def __is_empty(self, queue_id):
|
||||
return True
|
||||
tn = self.__connect()
|
||||
msg = '%s.queue\nexit\n' % queue_id
|
||||
tn.write(msg)
|
||||
output = tn.read_all().splitlines()
|
||||
if len(output) == 3:
|
||||
return len(output[0]) == 0
|
||||
else:
|
||||
raise Exception("Unexpected list length returned: %s" % output)
|
||||
|
||||
def queue_clear_all(self):
|
||||
try:
|
||||
|
@ -67,11 +75,11 @@ class TelnetLiquidsoap:
|
|||
def queue_push(self, queue_id, media_item):
|
||||
try:
|
||||
self.telnet_lock.acquire()
|
||||
tn = self.__connect()
|
||||
|
||||
if not self.__is_empty(tn, queue_id):
|
||||
if not self.__is_empty(queue_id):
|
||||
raise QueueNotEmptyException()
|
||||
|
||||
tn = self.__connect()
|
||||
annotation = create_liquidsoap_annotation(media_item)
|
||||
msg = '%s.push %s\n' % (queue_id, annotation.encode('utf-8'))
|
||||
self.logger.debug(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue