Skip to content

Commit

Permalink
fix divzero error in distance debug output in lastid plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecker committed Apr 4, 2011
1 parent 09eb0e9 commit 4eead8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beetsplug/lastid.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def track_distance(self, item, info):
dist_max += autotag.TRACK_ID_WEIGHT

# log.debug('Last data: %s; distance: %f' %
# (str(last_data), dist/dist_max))
# (str(last_data), dist/dist_max if dist_max > 0.0 else 0.0))

return dist * DISTANCE_SCALE, dist_max * DISTANCE_SCALE

Expand All @@ -114,7 +114,7 @@ def album_distance(self, items, info):
dist_max += autotag.ARTIST_WEIGHT

log.debug('Last artist (%s/%s) distance: %f' %
(last_artist, info['artist'], dist/dist_max))
(last_artist, info['artist'], dist/dist_max if dist_max > 0.0 else 0.0))

#fixme: artist MBID currently ignored (as in vanilla tagger)
return dist, dist_max
Expand Down

0 comments on commit 4eead8d

Please sign in to comment.