Merge branch '2.2.x' into devel
Conflicts: airtime_mvc/application/controllers/ShowbuilderController.php airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js airtime_mvc/public/js/airtime/common/common.js
This commit is contained in:
commit
7d8079f770
38 changed files with 361 additions and 105 deletions
|
@ -43,7 +43,7 @@ class EventRegistry(object):
|
|||
methods")
|
||||
|
||||
|
||||
class EventProxy(object):
|
||||
class EventProxy(Loggable):
|
||||
"""
|
||||
A container object for instances of BaseEvent (or it's subclasses) used for
|
||||
event contractor
|
||||
|
|
|
@ -182,7 +182,7 @@ class Metadata(Loggable):
|
|||
that does not exist. Setting metadata to {}")
|
||||
self.__metadata = {}
|
||||
return
|
||||
# TODO : Simplify the way all of these rules are handled right not it's
|
||||
# TODO : Simplify the way all of these rules are handled right now it's
|
||||
# extremely unclear and needs to be refactored.
|
||||
#if full_mutagen is None: raise BadSongFile(fpath)
|
||||
if full_mutagen is None: full_mutagen = FakeMutagen(fpath)
|
||||
|
@ -190,7 +190,6 @@ class Metadata(Loggable):
|
|||
# Now we extra the special values that are calculated from the mutagen
|
||||
# object itself:
|
||||
|
||||
# Hickity Hackity for .wav files. Properly do this later
|
||||
if mmp.extension(fpath) == 'wav':
|
||||
full_mutagen.set_length(mmp.read_wave_duration(fpath))
|
||||
|
||||
|
|
|
@ -126,7 +126,8 @@ class WatchSyncer(ReportHandler,Loggable):
|
|||
try:
|
||||
# If there is a strange bug anywhere in the code the next line
|
||||
# should be a suspect
|
||||
if self.contractor.register(EventProxy(event)): self.push_queue( event )
|
||||
ev = EventProxy(event)
|
||||
if self.contractor.register(ev): self.push_queue(ev)
|
||||
#self.push_queue( event )
|
||||
except BadSongFile as e:
|
||||
self.fatal_exception("Received bas song file '%s'" % e.path, e)
|
||||
|
|
|
@ -39,7 +39,7 @@ class TestMMP(unittest.TestCase):
|
|||
orig = Metadata.airtime_dict({
|
||||
'date' : [u'2012-08-21'],
|
||||
'tracknumber' : [u'2'],
|
||||
'title' : [u'11-29-00-record'],
|
||||
'title' : [u'record-2012-08-21-11:29:00'],
|
||||
'artist' : [u'Airtime Show Recorder']
|
||||
})
|
||||
orga = Metadata.airtime_dict({
|
||||
|
@ -57,7 +57,7 @@ class TestMMP(unittest.TestCase):
|
|||
|
||||
self.assertEqual( orga, normalized )
|
||||
|
||||
organized_base_name = "2012-08-21-11-29-00-record-256kbps.ogg"
|
||||
organized_base_name = "11:29:00-record-256kbps.ogg"
|
||||
base = "/srv/airtime/stor/"
|
||||
organized_path = mmp.organized_path(old_path,base, normalized)
|
||||
self.assertEqual(os.path.basename(organized_path), organized_base_name)
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue