mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 22:42:44 +01:00
move format_index to show_match_tracks
This commit is contained in:
parent
8f578e4495
commit
36f53ef00b
1 changed files with 21 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue