mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 12:02:44 +01:00
Merge pull request #3377 from rhlahuja/beatport-handle-none-key
[beatport] Exclude invalid musical keys
This commit is contained in:
commit
56d382f58e
2 changed files with 6 additions and 4 deletions
|
|
@ -257,10 +257,10 @@ class BeatportTrack(BeatportObject):
|
|||
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'):
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue