Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beatport] Exclude invalid musical keys #3377

Merged
merged 5 commits into from
Sep 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions beetsplug/beatport.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ def __init__(self, data):
self.url = "https://beatport.com/track/{0}/{1}" \
.format(data['slug'], data['id'])
self.track_number = data.get('trackNumber')
if 'bpm' in data:
self.bpm = data['bpm']
if 'key' in data:
self.musical_key = six.text_type(data['key'].get('shortName'))
self.bpm = data.get('bpm')
self.musical_key = six.text_type(
(data.get('key') or {}).get('shortName')
)

# Use 'subgenre' and if not present, 'genre' as a fallback.
if data.get('subGenres'):
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ New features:
* :doc:`/plugins/beatport`: The plugin now gets the musical key, BPM and the
genre for each track.
:bug:`2080`
* :doc:`/plugins/beatport`: Fix default assignment of the musical key.
:bug:`3377`

Fixes:

Expand Down