From 1a87483877bd56070e75562e18f55e6adc006ed0 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 2 Apr 2011 20:42:07 -0700 Subject: [PATCH] hide artist in difference display for VA matches --- beets/ui/commands.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index ae71e60f3..17aea209f 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -50,6 +50,8 @@ DEFAULT_IMPORT_RESUME = None # "ask" DEFAULT_THREADED = True DEFAULT_COLOR = True +VARIOUS_ARTISTS = u'Various Artists' + class ImportAbort(Exception): """Raised when the user aborts the tagging operation. """ @@ -76,16 +78,28 @@ def show_change(cur_artist, cur_album, items, info, dist, color=True): tags are changed from (cur_artist, cur_album, items) to info with distance dist. """ - if cur_artist != info['artist'] or cur_album != info['album']: + def show_album(artist, album): + if artist: + print_(' %s - %s' % (artist, album)) + else: + print_(' %s' % album) + + if cur_artist != info['artist'] or \ + (cur_album != info['album'] and info['album'] != VARIOUS_ARTISTS): artist_l, artist_r = cur_artist or '', info['artist'] album_l, album_r = cur_album or '', info['album'] + if artist_r == VARIOUS_ARTISTS: + # Hide artists for VA releases. + artist_l, artist_r = u'', u'' + if color: artist_l, artist_r = ui.colordiff(artist_l, artist_r) album_l, album_r = ui.colordiff(album_l, album_r) + print_("Correcting tags from:") - print_(' %s - %s' % (artist_l, album_l)) + show_album(artist_l, album_l) print_("To:") - print_(' %s - %s' % (artist_r, album_r)) + show_album(artist_r, album_r) else: print_("Tagging: %s - %s" % (info['artist'], info['album'])) print_('(Distance: %s)' % dist_string(dist, color))