Improved display of missing and unmatched tracks.

Display similar title lines for missing and unmatched tracks, to
separate them from matched tracks. When media numbers or titles are
shown, it looks like missing tracks are grouped under the last media.

With missing and unmatched tracks grouped under a heading now, we don't
need to display "missing track" or "unmatched track" on every line,
making it easier to read the track titles.

Change the prefix from " * " (same as matched tracks) to " ! " for
missing and " ? " for unmatched tracks.

Consistently format track index for both missing and unmatched tracks.
Previously we were omitting the # for missing tracks (compared to
matched tracks), and we were just showing the index (no # or media
number) for unmatched tracks.

Also display track length, if available.
This commit is contained in:
Tai Lee 2013-05-25 01:26:06 +10:00
parent b46e905a9c
commit c99280ea95

View file

@ -333,15 +333,20 @@ def show_change(cur_artist, cur_album, match):
print_(u'%s%s -> %s' % (lhs, ' ' * pad, rhs))
# Missing and unmatched tracks.
if match.extra_tracks:
print_('Missing tracks:')
for track_info in match.extra_tracks:
line = u' * Missing track: {0} ({1})'.format(track_info.title,
format_index(track_info))
line = ui.colorize('yellow', line)
print_(line)
line = ' ! %s (#%s)' % (track_info.title, format_index(track_info))
if track_info.length:
line += ' (%s)' % ui.human_seconds_short(track_info.length)
print_(ui.colorize('yellow', line))
if match.extra_items:
print_('Unmatched tracks:')
for item in match.extra_items:
line = u' * Unmatched track: {0} ({1})'.format(item.title, item.track)
line = ui.colorize('yellow', line)
print_(line)
line = ' ! %s (#%s)' % (item.title, format_index(item))
if item.length:
line += ' (%s)' % ui.human_seconds_short(item.length)
print_(ui.colorize('yellow', line))
def show_item_change(item, match):
"""Print out the change that would occur by tagging `item` with the