Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
Conflicts: python_apps/pypo/pypopush.py
This commit is contained in:
commit
29afb6e191
29 changed files with 496 additions and 266 deletions
|
@ -9,6 +9,7 @@ import telnetlib
|
|||
import calendar
|
||||
import json
|
||||
import math
|
||||
from pypofetch import PypoFetch
|
||||
|
||||
from Queue import Empty
|
||||
|
||||
|
@ -204,7 +205,9 @@ class PypoPush(Thread):
|
|||
|
||||
for mkey in sorted_keys:
|
||||
media_item = media_schedule[mkey]
|
||||
if len(current_chain) == 0:
|
||||
if media_item['type'] == "event":
|
||||
chains.append([media_item])
|
||||
elif len(current_chain) == 0:
|
||||
current_chain.append(media_item)
|
||||
elif media_item['start'] == current_chain[-1]['end']:
|
||||
current_chain.append(media_item)
|
||||
|
@ -240,7 +243,6 @@ class PypoPush(Thread):
|
|||
tnow = datetime.utcnow()
|
||||
current_chain = []
|
||||
|
||||
|
||||
for chain in chains:
|
||||
iteration = 0
|
||||
for link in chain:
|
||||
|
@ -284,7 +286,13 @@ class PypoPush(Thread):
|
|||
|
||||
try:
|
||||
for media_item in media_item_chain:
|
||||
self.telnet_to_liquidsoap(media_item)
|
||||
if media_item['type'] == "file":
|
||||
self.telnet_to_liquidsoap(media_item)
|
||||
elif media_item['type'] == "event":
|
||||
if media_item['event_type'] == "kick_out":
|
||||
PypoFetch.disconnect_source(self.logger, self.telnet_lock, "live_dj")
|
||||
elif media_item['event_type'] == "switch_off":
|
||||
PypoFetch.switch_source(self.logger, self.telnet_lock, "live_dj", "off")
|
||||
except Exception, e:
|
||||
self.logger.error('Pypo Push Exception: %s', e)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue