mirror of
https://github.com/beetbox/beets.git
synced 2026-02-11 09:54:31 +01:00
echonest_tempo/#420: py26, line wrap, ...
This commit is contained in:
parent
52312ee877
commit
b037f777da
1 changed files with 10 additions and 5 deletions
|
|
@ -102,12 +102,17 @@ def get_tempo(artist, title, duration):
|
|||
min_distance = duration
|
||||
pick = None
|
||||
for result in results:
|
||||
if result.artist_name.lower() == artist and result.title.lower() == title:
|
||||
if result.artist_name.lower() == artist and \
|
||||
result.title.lower() == title:
|
||||
distance = abs(duration - result.audio_summary['duration'])
|
||||
log.debug(u'echonest_tempo: candidate {} - {} [abs({:2.2f}-{:2.2f})={:2.2f}] = {}'.format(
|
||||
result.artist_name, result.title,
|
||||
result.audio_summary['duration'], duration, distance,
|
||||
result.audio_summary['tempo']))
|
||||
log.debug(
|
||||
u'echonest_tempo: candidate {0:2.2f} '
|
||||
u'(distance: {1:2.2f}) = {2}'.format(
|
||||
result.audio_summary['duration'],
|
||||
distance,
|
||||
result.audio_summary['tempo'],
|
||||
)
|
||||
)
|
||||
if distance < min_distance:
|
||||
min_distance = distance
|
||||
pick = result.audio_summary['tempo']
|
||||
|
|
|
|||
Loading…
Reference in a new issue