From 36f53ef00ba4970f1fba74453e50ca095b73a0cb Mon Sep 17 00:00:00 2001 From: Maximilian Merz Date: Fri, 19 Feb 2016 17:20:42 +0100 Subject: [PATCH] move format_index to show_match_tracks --- beets/ui/commands.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 04aba1737..995a01ecf 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -198,27 +198,6 @@ def show_change(cur_artist, cur_album, match): album's tags are changed according to `match`, which must be an AlbumMatch object. """ - def format_index(track_info): - """Return a string representing the track index of the given - TrackInfo or Item object. - """ - if isinstance(track_info, hooks.TrackInfo): - index = track_info.index - medium_index = track_info.medium_index - medium = track_info.medium - mediums = match.info.mediums - else: - index = medium_index = track_info.track - medium = track_info.disc - mediums = track_info.disctotal - if config['per_disc_numbering']: - if mediums > 1: - return u'{0}-{1}'.format(medium, medium_index) - else: - return unicode(medium_index) - else: - return unicode(index) - def show_match_header(): """Print out a 'header' identifying the suggested match (album name, artist name,...) and summarizing the changes that would be made should @@ -438,6 +417,27 @@ def show_change(cur_artist, cur_album, match): col_width_r = col_width return col_width_l, col_width_r + def format_index(track_info): + """Return a string representing the track index of the given + TrackInfo or Item object. + """ + if isinstance(track_info, hooks.TrackInfo): + index = track_info.index + medium_index = track_info.medium_index + medium = track_info.medium + mediums = match.info.mediums + else: + index = medium_index = track_info.track + medium = track_info.disc + mediums = track_info.disctotal + if config['per_disc_numbering']: + if mediums > 1: + return u'{0}-{1}'.format(medium, medium_index) + else: + return unicode(medium_index) + else: + return unicode(index) + def format_track(indent, prefix, lhs_width, rhs_width, col_width_l, col_width_r, lhs, rhs): """docstring for format_track""" # Print track