Adrian Sampson committed 8bec4a5

max_rec (#98): fix bug w/ multiple track triggers

If both "tracklength" and "tracknumber" triggers occur for a certain album,
then the *lowest* recommendation max should be used. (With the `break`s in
there, it would just be the first trigger found.)

  • Participants
  • Parent commits 4a412b6

Comments (0)

Files changed (1)


                     item.length and track_info.length and \
                     abs(item.length - track_info.length) > TRACK_LENGTH_GRACE:
                 rec = max_rec['tracklength']
-                break
             # Track number differs.
             elif rec > max_rec['tracknumber'] and item.track not in \
                     (track_info.index, track_info.medium_index):
                 rec = max_rec['tracknumber']
-                break
     return rec