Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x

This commit is contained in:
James 2012-10-16 12:07:02 -04:00
commit 75db11d780
2 changed files with 15 additions and 7 deletions

View file

@ -16,12 +16,12 @@ class Application_Model_PlayoutHistory
private $opts;
private $mDataPropMap = array(
"artist" => "file.artist_name",
"title" => "file.track_title",
"played" => "playout.played",
"length" => "file.length",
"composer" => "file.composer",
"copyright" => "file.copyright",
"artist" => "artist_name",
"title" => "track_title",
"played" => "played",
"length" => "length",
"composer" => "composer",
"copyright" => "copyright",
);
public function __construct($p_startDT, $p_endDT, $p_opts)

View file

@ -399,7 +399,15 @@ class PypoPush(Thread):
def date_interval_to_seconds(self, interval):
return (interval.microseconds + (interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
"""
Convert timedelta object into int representing the number of seconds. If
number of seconds is less than 0, then return 0.
"""
seconds = (interval.microseconds + \
(interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
if seconds < 0: seconds = 0
return seconds
def push_to_liquidsoap(self, event_chain):