Skip to content
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