Skip to content

Fix #2080 - #3372

Merged
sampsyo merged 8 commits into
beetbox:masterfrom
temrix:master
Sep 19, 2019
Merged

Fix #2080#3372
sampsyo merged 8 commits into
beetbox:masterfrom
temrix:master

Conversation

@temrix

@temrix temrix commented Sep 18, 2019

Copy link
Copy Markdown
Contributor

This fixes feature request #2080 .

I have added bpm, musical_key and genre in the beatport plugin. I needed to modify the hooks in the autotagger to accept those additional attributes. genre will be fetched for each track. I have also added a test file to test the plugin.

@sampsyo sampsyo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks wonderful; thank you!! Really nice work on this.

I just have one small suggestion for the docs.

Comment thread docs/plugins/beatport.rst Outdated
@sampsyo

sampsyo commented Sep 19, 2019

Copy link
Copy Markdown
Member

The tests revealed that we might need to add requests_oauthlib to the test dependencies:
https://travis-ci.org/beetbox/beets/jobs/587184180#L930

Those are listed in our Tox config:

beets/tox.ini

Lines 13 to 26 in 3ffd5ca

deps =
beautifulsoup4
flask
mock
nose
nose-show-skipped
pylast
rarfile
responses>=0.3.0
pyxdg
jellyfish
python-mpd2
coverage
discogs-client

@temrix

temrix commented Sep 19, 2019

Copy link
Copy Markdown
Contributor Author

Ah, I have thought before that the extras_require in setup.py would take care of this but I did not know where I should put it instead.

@sampsyo

sampsyo commented Sep 19, 2019

Copy link
Copy Markdown
Member

Perfect! Let me re-emphasize that we really appreciate your adding such extensive tests for the plugin. Wahoo!

@sampsyo
sampsyo merged commit db7ef0e into beetbox:master Sep 19, 2019
@wualex

wualex commented Sep 20, 2019

Copy link
Copy Markdown

@temrix i just updated my beets install and i tried to import a test dir with few tracks and i get the following error:

Traceback (most recent call last):
File "/usr/local/bin/beet", line 11, in
load_entry_point('beets==1.5.0', 'console_scripts', 'beet')()
File "/usr/local/lib/python2.7/dist-packages/beets/ui/init.py", line 1267, in main
_raw_main(args)
File "/usr/local/lib/python2.7/dist-packages/beets/ui/init.py", line 1254, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/local/lib/python2.7/dist-packages/beets/ui/commands.py", line 956, in import_func
import_files(lib, paths, query)
File "/usr/local/lib/python2.7/dist-packages/beets/ui/commands.py", line 926, in import_files
session.run()
File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 329, in run
pl.run_parallel(QUEUE_SIZE)
File "/usr/local/lib/python2.7/dist-packages/beets/util/pipeline.py", line 445, in run_parallel
six.reraise(exc_info[0], exc_info[1], exc_info[2])
File "/usr/local/lib/python2.7/dist-packages/beets/util/pipeline.py", line 312, in run
out = self.coro.send(msg)
File "/usr/local/lib/python2.7/dist-packages/beets/util/pipeline.py", line 194, in coro
func(*(args + (task,)))
File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 1353, in lookup_candidates
task.lookup_candidates()
File "/usr/local/lib/python2.7/dist-packages/beets/importer.py", line 641, in lookup_candidates
autotag.tag_album(self.items, search_ids=self.search_ids)
File "/usr/local/lib/python2.7/dist-packages/beets/autotag/match.py", line 460, in tag_album
va_likely):
File "/usr/local/lib/python2.7/dist-packages/beets/plugins.py", line 576, in decorated
for v in generator(*args, **kwargs):
File "/usr/local/lib/python2.7/dist-packages/beets/autotag/hooks.py", line 637, in album_candidates
for candidate in plugins.candidates(items, artist, album, va_likely):
File "/usr/local/lib/python2.7/dist-packages/beets/plugins.py", line 386, in candidates
for candidate in plugin.candidates(items, artist, album, va_likely):
File "/usr/local/lib/python2.7/dist-packages/beetsplug/beatport.py", line 360, in candidates
return self._get_releases(query)
File "/usr/local/lib/python2.7/dist-packages/beetsplug/beatport.py", line 412, in _get_releases
for x in self.client.search(query)]
File "/usr/local/lib/python2.7/dist-packages/beetsplug/beatport.py", line 138, in search
release = self.get_release(item['id'])
File "/usr/local/lib/python2.7/dist-packages/beetsplug/beatport.py", line 154, in get_release
release.tracks = self.get_release_tracks(beatport_id)
File "/usr/local/lib/python2.7/dist-packages/beetsplug/beatport.py", line 166, in get_release_tracks
return [BeatportTrack(t) for t in response]
File "/usr/local/lib/python2.7/dist-packages/beetsplug/beatport.py", line 265, in init
self.genre = six.text_type(data['subGenres'][0].get('name'))
IndexError: list index out of range

@temrix

temrix commented Sep 20, 2019

Copy link
Copy Markdown
Contributor Author

Can you open a new issue with this? We can discuss there. And try to pin-point the track or at least a range of albums the error has occurred with.

snorkelopsstgtesting1-spec pushed a commit to snorkel-marlin-repos/beetbox_beets_pr_3372_2c236d1d-4bb7-4e0e-a68b-22d3727bde6b that referenced this pull request Oct 22, 2025
Original PR #3372 by temrix
Original: beetbox/beets#3372
snorkelopstesting1-a11y added a commit to snorkel-marlin-repos/beetbox_beets_pr_3372_2c236d1d-4bb7-4e0e-a68b-22d3727bde6b that referenced this pull request Oct 22, 2025
Merged from original PR #3372
Original: beetbox/beets#3372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants