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

Fix #2080 #3372

Merged
merged 8 commits into from
Sep 19, 2019
Merged

Fix #2080 #3372

merged 8 commits into from
Sep 19, 2019

Conversation

temrix
Copy link
Contributor

@temrix temrix commented Sep 18, 2019

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.

Copy link
Member

@sampsyo sampsyo left a comment

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.

docs/plugins/beatport.rst Outdated Show resolved Hide resolved
@sampsyo
Copy link
Member

sampsyo commented Sep 19, 2019

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
Copy link
Contributor Author

temrix commented Sep 19, 2019

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
Copy link
Member

sampsyo commented Sep 19, 2019

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
Copy link

wualex commented Sep 20, 2019

@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
Copy link
Contributor Author

temrix commented Sep 20, 2019

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.

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