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

This commit is contained in:
James 2012-09-05 16:12:44 -04:00
commit 15b9d09991
6 changed files with 21 additions and 13 deletions

View File

@ -1833,7 +1833,8 @@ SELECT si.starts AS start_timestamp,
starts,
ends
FROM cc_show_instances si,
cc_show s
LEFT JOIN cc_show s
ON si.instance_id = s.id
WHERE si.show_id = s.id
AND si.starts <= :timeNow1::timestamp
AND si.ends > :timeNow2::timestamp
@ -1875,7 +1876,8 @@ SELECT si.starts AS start_timestamp,
starts,
ends
FROM cc_show_instances si,
cc_show s
LEFT JOIN cc_show s
ON si.instance_id = s.id
WHERE si.show_id = s.id
AND si.starts > :timeNow1::timestamp - INTERVAL '2 days'
AND si.ends < :timeNow2::timestamp + INTERVAL '2 days'
@ -2012,9 +2014,10 @@ SELECT si.starts AS start_timestamp,
s.url,
starts,
ends
FROM cc_show_instances,
cc_show
WHERE si.show_id = s.id"
FROM cc_show_instances si
LEFT JOIN cc_show s
ON si.instance_id = s.id
WHERE si.show_id = s.id
AND si.starts >= :timeStart::timestamp
AND si.starts < :timeEnd::timestamp
AND modified_instance != TRUE

View File

@ -48,8 +48,12 @@ class EventContractor(Loggable):
# checked against the newest event 'evt' in this case
self.unregister( old_e )
evt.add_safe_pack_hook( lambda : self.__unregister(evt) )
assert evt.path not in self.store, \
"Clean up should have been called by '%s'" % evt
if evt.path in self.store:
self.logger.warn("Clean up should have been called by '%s'" %
str(evt))
self.logger.warn("Overwriting event for '%s'" % evt.path)
self.store[ evt.path ] = evt
return True # We actually added something, hence we return true.

View File

@ -113,9 +113,9 @@ class BaseEvent(Loggable):
self._raw_event = evt
self.path = evt.path
self.__class__ = evt.__class__
# We don't transfer the _pack_hook over to the new event
# TODO : perhaps we should call the old events pack_hook just to make
# sure everything is done cleanly?
# Clean up old hook and transfer the new events hook
self.reset_hook()
self.add_safe_pack_hook( evt._pack_hook )
return self
def assign_owner(self,req):

View File

@ -172,6 +172,7 @@ class Metadata(Loggable):
return
# TODO : Simplify the way all of these rules are handled right not it's
# extremely unclear and needs to be refactored.
if full_mutagen is None: raise BadSongFile(fpath)
self.__metadata = Metadata.airtime_dict(full_mutagen)
# Now we extra the special values that are calculated from the mutagen
# object itself:

View File

@ -477,10 +477,11 @@ def file_playable(pathname):
#between them. We run the command as pypo because otherwise the target file
#is opened with write permissions, and this causes an inotify ON_CLOSE_WRITE
#event to be fired :/
return True
command = ("airtime-liquidsoap -c 'output.dummy" + \
"(audio_to_stereo(single(\"%s\")))' > /dev/null 2>&1") % \
pathname.replace("'", "'\\''")
print(command)
return True
return_code = subprocess.call(command, shell=True)
return (return_code == 0)

View File

@ -5,8 +5,7 @@ pid_found="$?"
if [ "$pid_found" == "0" ]; then
#PID is available in the status message
rabbitmqstatus=`/etc/init.d/rabbitmq-server status | grep "\[{pid"`
rabbitmqpid=`echo $rabbitmqstatus | sed "s/.*,\(.*\)\}.*/\1/"`
rabbitmqpid=`/etc/init.d/rabbitmq-server status | grep "\[{pid" | sed "s/.*,\(.*\)\}.*/\1/"`
else
#PID should be available from file
rabbitmqpid=`sed "s/.*,\(.*\)\}.*/\1/" /var/lib/rabbitmq/pids`