Skip to content

Commit

Permalink
Merge pull request #2816 from beetbox/better-release-event
Browse files Browse the repository at this point in the history
Make sure release events are selected in preferred order.
  • Loading branch information
sampsyo authored Feb 23, 2018
2 parents d6b6ebb + 5d2e203 commit 3460723
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beets/autotag/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def _preferred_release_event(release):
"""
countries = config['match']['preferred']['countries'].as_str_seq()

for event in release.get('release-event-list', {}):
for country in countries:
for country in countries:
for event in release.get('release-event-list', {}):
try:
if country in event['area']['iso-3166-1-code-list']:
return country, event['date']
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Fixes:
incompatible between the source and target file formats.
:bug:`2814`
Thanks to :user:`autrimpo`.
* Importing a release with multiple release events now selects the
event based on the order of your :ref:`preferred` countries rather than
the order of release events in MusicBrainz. :bug:`2816`

For developers:

Expand Down

0 comments on commit 3460723

Please sign in to comment.