Skip to content

Commit

Permalink
Merge pull request #87 from pscn/master
Browse files Browse the repository at this point in the history
Use release disambiguation not release-group disambiguation and more
  • Loading branch information
sampsyo committed Feb 2, 2013
2 parents 8968989 + 663574c commit 5f5d3f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beets/autotag/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def album_info(release):
info.va = info.artist_id == VARIOUS_ARTISTS_ID
info.asin = release.get('asin')
info.releasegroup_id = release['release-group']['id']
info.albumdisambig = release['release-group'].get('disambiguation')
info.albumdisambig = release.get('disambiguation')
info.country = release.get('country')
info.albumstatus = release.get('status')

Expand Down
8 changes: 7 additions & 1 deletion beets/ui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,13 @@ def choose_candidate(candidates, singleton, rec, cur_artist=None,
if match.info.year:
disambig.append(unicode(match.info.year))
if match.info.media:
disambig.append(match.info.media)
if match.info.mediums > 1:
disambig.append(u'{0}x{1}'.format(
match.info.mediums, match.info.media))
else:
disambig.append(match.info.media)
if match.info.albumdisambig:
disambig.append(match.info.albumdisambig)
if disambig:
line += u' [{0}]'.format(u', '.join(disambig))

Expand Down
1 change: 1 addition & 0 deletions test/test_mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def _make_release(self, date_str='2009', tracks=None):
'title': 'ALBUM TITLE',
'id': 'ALBUM ID',
'asin': 'ALBUM ASIN',
'disambiguation': 'DISAMBIGUATION',
'release-group': {
'type': 'Album',
'first-release-date': date_str,
Expand Down

0 comments on commit 5f5d3f1

Please sign in to comment.