diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 8850c7d34..3d469d395 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -441,30 +441,6 @@ def colordiff(a, b, highlight='red'): return unicode(a), unicode(b) -def color_diff_suffix(a, b, highlight='red'): - """Colorize the differing suffix between two strings.""" - a, b = unicode(a), unicode(b) - if not config['color']: - return a, b - - # Fast path. - if a == b: - return a, b - - # Find the longest common prefix. - first_diff = None - for i in range(min(len(a), len(b))): - if a[i] != b[i]: - first_diff = i - break - else: - first_diff = min(len(a), len(b)) - - # Colorize from the first difference on. - return (a[:first_diff] + colorize(highlight, a[first_diff:]), - b[:first_diff] + colorize(highlight, b[first_diff:])) - - def get_path_formats(subview=None): """Get the configuration's path formats as a list of query/template pairs. diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 36910f9e9..947fc22ba 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -318,17 +318,9 @@ def show_change(cur_artist, cur_album, match): color = 'lightgray' else: color = 'red' - if (cur_track + new_track).count('-') == 1: - lhs_track, rhs_track = (ui.colorize(color, cur_track), - ui.colorize(color, new_track)) - else: - color = 'red' - lhs_track, rhs_track = ui.color_diff_suffix(cur_track, - new_track) - templ = (ui.colorize(color, u' (#') + u'{0}' + - ui.colorize(color, u')')) - lhs += templ.format(lhs_track) - rhs += templ.format(rhs_track) + templ = ui.colorize(color, u' (#{0})') + lhs += templ.format(cur_track) + rhs += templ.format(new_track) lhs_width += len(cur_track) + 4 # Length change. @@ -337,12 +329,9 @@ def show_change(cur_artist, cur_album, match): config['ui']['length_diff_thresh'].as_number(): cur_length = ui.human_seconds_short(item.length) new_length = ui.human_seconds_short(track_info.length) - lhs_length, rhs_length = ui.color_diff_suffix(cur_length, - new_length) - templ = (ui.colorize('red', u' (') + u'{0}' + - ui.colorize('red', u')')) - lhs += templ.format(lhs_length) - rhs += templ.format(rhs_length) + templ = ui.colorize('red', u' ({0})') + lhs += templ.format(cur_length) + rhs += templ.format(new_length) lhs_width += len(cur_length) + 3 # Penalties. diff --git a/docs/changelog.rst b/docs/changelog.rst index 0d6292c60..965a31bf0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -24,6 +24,9 @@ Fixes: an argument. * :doc:`/plugins/play`: Remove the temporary .m3u file after sending it to the player. +* The importer no longer tries to highlight partial differences in numeric + quantities (track numbers and durations), which was often confusing. + 1.3.8 (September 17, 2014) --------------------------