Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2012-04-11 12:27:54 -04:00
commit 13502b4c08
4 changed files with 17 additions and 9 deletions

View File

@ -525,12 +525,13 @@ class Application_Model_Schedule {
foreach ($items as $item){
$storedFile = Application_Model_StoredFile::Recall($item["file_id"]);
$uri = $storedFile->getFilePath();
$showEndDateTime = new DateTime($item["show_end"], $utcTimeZone);
$trackStartDateTime = new DateTime($item["start"], $utcTimeZone);
$trackEndDateTime = new DateTime($item["end"], $utcTimeZone);
if ($trackStartDateTime->getTimestamp() > $showEndDateTime->getTimestamp()){
continue;
}
/* Note: cue_out and end are always the same. */
/* TODO: Not all tracks will have "show_end" */
@ -538,8 +539,12 @@ class Application_Model_Schedule {
$di = $trackStartDateTime->diff($showEndDateTime);
$item["cue_out"] = $di->format("%H:%i:%s").".000";
$item["end"] = $showEndDateTime->format("Y-m-d H:i:s");
}
$storedFile = Application_Model_StoredFile::Recall($item["file_id"]);
$uri = $storedFile->getFilePath();
$start = Application_Model_Schedule::AirtimeTimeToPypoTime($item["start"]);
$data["media"][$start] = array(
'id' => $storedFile->getGunid(),

View File

@ -79,7 +79,7 @@
<span id="stream_url"><?php echo $this->master_dj_connection_url ?></span> <a href=# id="connection_url_override" style="font-size: 12px;">override</a>&nbsp;&nbsp;
<span class='info-tooltip'>
<span>
This is the URL to display to DJs who would like to connect a stream to Airtime. If Airtime is behind a router or firewall, you will need to use port forwarding on the router to forward connections to the ports that you configure here. For more detailed information on what this means, click <a target="_blank" href="#">here</a>.
This is the URL used by remote sources to connect to Airtime. If Airtime is behind a router or firewall, you may need to configure port forwarding. For details, please read the <a target="_blank" href="http://manuals.sourcefabric.org/">Airtime manual</a>.
</span>
</span><br>
<div id="master_dj_connection_url_tb" style="display:none"><input type="text"><a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a></div>

View File

@ -298,7 +298,7 @@ def test_file_playability(pathname):
"""
liquidsoap_found = subprocess.call("which liquidsoap", shell=True)
if liquidsoap_found == 0:
return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace("'", "\\'"), shell=True)
return_code = subprocess.call("liquidsoap -r \"%s\"" % pathname.replace('"', '\\"'), shell=True)
else:
return_code = 0

View File

@ -173,6 +173,7 @@ class PypoPush(Thread):
if problem_at_iteration is not None:
self.logger.debug("Change in chain at link %s", problem_at_iteration)
self.modify_cue_point_of_first_link(current_chain)
self.push_to_liquidsoap(current_chain[problem_at_iteration:])
@ -249,11 +250,13 @@ class PypoPush(Thread):
link_start = datetime.strptime(link['start'], "%Y-%m-%d-%H-%M-%S")
diff_td = tnow - link_start
diff_sec = self.convert_timedelta_to_seconds(diff_td)
self.logger.debug("media item was supposed to start %s ago. Preparing to start..", diff_td)
original_cue_in_td = timedelta(seconds=float(link['cue_in']))
link['cue_in'] = self.convert_timedelta_to_seconds(original_cue_in_td + diff_td)
if diff_sec > 0:
self.logger.debug("media item was supposed to start %s ago. Preparing to start..", diff_sec)
original_cue_in_td = timedelta(seconds=float(link['cue_in']))
link['cue_in'] = self.convert_timedelta_to_seconds(original_cue_in_td) + diff_sec
def convert_timedelta_to_seconds(self, td):
return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6