* morituri/test/release.c7d919f4-3ea0-4c4b-a230-b3605f069440.xml:
Add release data for Bettie Serveert, Lamprey * morituri/test/test_common_program.py: Add a test for parsing and getting the whole duration. * morituri/common/common.py: Add a method to format time. * morituri/common/program.py: Add duration to tracks and release metadatas. When there are multiple matches, look up the closest in duration. Make sure that multiple matches closest in duration contain same artist and title. Complain about the other ones. * morituri/image/table.py: Add a method to calculate a duration from the table. * morituri/test/test_image_table.py: Add a test for it.
This commit is contained in:
@@ -427,6 +427,14 @@ class Table(object, log.Loggable):
|
||||
return urlparse.urlunparse((
|
||||
'http', host, '/bare/cdlookup.html', '', query, ''))
|
||||
|
||||
def duration(self):
|
||||
"""
|
||||
Get an estimate of the duration in ms.
|
||||
"""
|
||||
values = self._getMusicBrainzValues()
|
||||
leadout = values[2]
|
||||
first = values[3]
|
||||
return ((leadout - first) * 1000) / common.FRAMES_PER_SECOND
|
||||
|
||||
def _getMusicBrainzValues(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user