Revert "Merge branch 'ryerson-history'"
This reverts commita554c6f72c
, reversing changes made to2a0c9769aa
.
This commit is contained in:
parent
a554c6f72c
commit
c8b73850b9
200 changed files with 5491 additions and 41784 deletions
|
@ -93,6 +93,7 @@ class Metadata(Loggable):
|
|||
# little bit messy. Some of the handling is in m.m.pure while the rest is
|
||||
# here. Also interface is not very consistent
|
||||
|
||||
# TODO : what is this shit? maybe get rid of it?
|
||||
@staticmethod
|
||||
def fix_title(path):
|
||||
# If we have no title in path we will format it
|
||||
|
|
|
@ -474,28 +474,20 @@ def truncate_to_value(item, value):
|
|||
return str(item)
|
||||
|
||||
def format_length(mutagen_length):
|
||||
if convert_format(mutagen_length):
|
||||
""" Convert mutagen length to airtime length """
|
||||
t = float(mutagen_length)
|
||||
h = int(math.floor(t / 3600))
|
||||
t = t % 3600
|
||||
m = int(math.floor(t / 60))
|
||||
s = t % 60
|
||||
# will be ss.uuu
|
||||
s = str('{0:f}'.format(s))
|
||||
seconds = s.split(".")
|
||||
s = seconds[0]
|
||||
# have a maximum of 6 subseconds.
|
||||
if len(seconds[1]) >= 6: ss = seconds[1][0:6]
|
||||
else: ss = seconds[1][0:]
|
||||
return "%s:%s:%s.%s" % (h, m, s, ss)
|
||||
|
||||
def convert_format(value):
|
||||
regCompiled = re.compile("^[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.\d+)?$")
|
||||
if re.search(regCompiled, str(value)) is None:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
""" Convert mutagen length to airtime length """
|
||||
t = float(mutagen_length)
|
||||
h = int(math.floor(t / 3600))
|
||||
t = t % 3600
|
||||
m = int(math.floor(t / 60))
|
||||
s = t % 60
|
||||
# will be ss.uuu
|
||||
s = str('{0:f}'.format(s))
|
||||
seconds = s.split(".")
|
||||
s = seconds[0]
|
||||
# have a maximum of 6 subseconds.
|
||||
if len(seconds[1]) >= 6: ss = seconds[1][0:6]
|
||||
else: ss = seconds[1][0:]
|
||||
return "%s:%s:%s.%s" % (h, m, s, ss)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue