Merge branch '2.4.x'

Conflicts:
	python_apps/pypo/pypopush.py
	python_apps/pypo/schedule/pypofetch.py
	python_apps/pypo/schedule/pypofile.py
	python_apps/pypo/schedule/pypoliqqueue.py
This commit is contained in:
denise 2013-05-30 15:21:32 -04:00
commit 586bdf99e9
71 changed files with 5253 additions and 4614 deletions

View file

@ -378,11 +378,11 @@ class PypoFetch(Thread):
media_item['file_ready'] = False
media_filtered[key] = media_item
media_item['start'] = datetime.strptime(media_item['start'],
media_item['start'] = datetime.strptime(media_item['start'],
"%Y-%m-%d-%H-%M-%S")
media_item['end'] = datetime.strptime(media_item['end'],
"%Y-%m-%d-%H-%M-%S")
media_copy[media_item['start']] = media_item
media_copy[key] = media_item
self.media_prepare_queue.put(copy.copy(media_filtered))
except Exception, e: self.logger.error("%s", e)

View file

@ -76,14 +76,6 @@ class PypoFile(Thread):
self.logger.debug("copying from %s to local cache %s" % (src, dst))
try:
"""
List file as "ready" before it starts copying because by the
time Liquidsoap is ready to play this file, it should have at
least started copying (and can continue copying while
Liquidsoap reads from the beginning of the file)
"""
media_item['file_ready'] = True
"""
copy will overwrite dst if it already exists
"""
@ -91,6 +83,8 @@ class PypoFile(Thread):
#make file world readable
os.chmod(dst, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
media_item['file_ready'] = True
except Exception, e:
self.logger.error("Could not copy from %s to %s" % (src, dst))
self.logger.error(e)

View file

@ -74,8 +74,9 @@ class PypoLiqQueue(Thread):
schedule_deque.append(media_schedule[i])
if len(keys):
time_until_next_play = pure.date_interval_to_seconds(\
keys[0] - datetime.utcnow())
time_until_next_play = self.date_interval_to_seconds(
media_schedule[keys[0]]['start'] -
datetime.utcnow())
else:
time_until_next_play = None