agrausem / beets-artistcountry Goto Github PK
View Code? Open in Web Editor NEWBeets plugin to retrieve the country of an artist from Musicbrainz
License: MIT License
Beets plugin to retrieve the country of an artist from Musicbrainz
License: MIT License
Can you implement it running this plugin manually?
like so:
beet artistcountry QUERY
This can be quite useful if you want to add the field artist_country
to tracks that are already imported and you don't want to reimport your complete music library.
Many other plugins support that too. For example lastgenre.
$ pip install beets-artistcountry
Downloading/unpacking beets-artistcountry
Downloading beets-artistcountry-0.1.tar.gz
Running setup.py (path:/private/tmp/pip_build_root/beets-artistcountry/setup.py) egg_info for package beets-artistcountry
Traceback (most recent call last):
File "", line 17, in
File "/private/tmp/pip_build_root/beets-artistcountry/setup.py", line 14, in
long_description=open('README.rst').read(),
IOError: [Errno 2] No such file or directory: 'README.rst'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/private/tmp/pip_build_root/beets-artistcountry/setup.py", line 14, in
long_description=open('README.rst').read(),
IOError: [Errno 2] No such file or directory: 'README.rst'
Hello,
Any chance you could declare a license for this plugin? (Upstream beets is using an MIT license, so using that would make it 1:1 compatible for inclusion in upstream.)
Should this still work? On my end:
** error loading plugin artistcountry:
Traceback (most recent call last):
File "c:\users\redacted\appdata\local\programs\python\python36-32\lib\site-packages\beets\plugins.py", line 254, in load_plugins
namespace = __import__(modname, None, None)
File "c:\users\redacted\appdata\local\programs\python\python36-32\lib\site-packages\beetsplug\artistcountry.py", line 22
print "No country for %s" % artist_item['artist']['name']
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print "No country for %s" % artist_item['artist']['name'])?
Furhtermore - the reason I'm interested on the plugin is that I want a way to tag all possible albums with their country of origin. Can this be done with this plugin, or is it only for folder structures?
I'm having issues when running beet move. It's the first time that I run it with the plugin installed. Anything I can help with?
❯ beet move
Traceback (most recent call last):
File "/usr/local/bin/beet", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1209, in main
_raw_main(args)
File "/usr/local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1196, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/usr/local/lib/python2.7/site-packages/beets/ui/commands.py", line 1496, in move_func
opts.timid)
File "/usr/local/lib/python2.7/site-packages/beets/ui/commands.py", line 1457, in move_items
objs = [o for o in objs if (isalbummoved if album else isitemmoved)(o)]
File "/usr/local/lib/python2.7/site-packages/beets/ui/commands.py", line 1455, in <lambda>
isitemmoved = lambda item: item.path != item.destination(basedir=dest)
File "/usr/local/lib/python2.7/site-packages/beets/library.py", line 819, in destination
subpath = self.evaluate_template(subpath_tmpl, True)
File "/usr/local/lib/python2.7/site-packages/beets/dbcore/db.py", line 464, in evaluate_template
self._template_funcs())
File "/usr/local/lib/python2.7/site-packages/beets/util/functemplate.py", line 574, in substitute
res = self.interpret(values, functions)
File "/usr/local/lib/python2.7/site-packages/beets/util/functemplate.py", line 566, in interpret
return self.expr.evaluate(Environment(values, functions))
File "/usr/local/lib/python2.7/site-packages/beets/util/functemplate.py", line 274, in evaluate
out.append(part.evaluate(env))
File "/usr/local/lib/python2.7/site-packages/beets/util/functemplate.py", line 209, in evaluate
arg_vals = [expr.evaluate(env) for expr in self.args]
File "/usr/local/lib/python2.7/site-packages/beets/util/functemplate.py", line 274, in evaluate
out.append(part.evaluate(env))
File "/usr/local/lib/python2.7/site-packages/beets/util/functemplate.py", line 176, in evaluate
if self.ident in env.values:
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py", line 388, in __contains__
self[key]
File "/usr/local/lib/python2.7/site-packages/beets/library.py", line 382, in __getitem__
value = self._get(key)
File "/usr/local/lib/python2.7/site-packages/beets/library.py", line 373, in _get
return self._get_formatted(self.model, key)
File "/usr/local/lib/python2.7/site-packages/beets/dbcore/db.py", line 69, in _get_formatted
value = model._type(key).format(model.get(key))
File "/usr/local/lib/python2.7/site-packages/beets/dbcore/db.py", line 305, in get
return self[key]
File "/usr/local/lib/python2.7/site-packages/beets/dbcore/db.py", line 228, in __getitem__
return getters[key](self)
File "/usr/local/lib/python2.7/site-packages/beetsplug/artistcountry.py", line 12, in memf
cache[artist_id] = f(item)
File "/usr/local/lib/python2.7/site-packages/beetsplug/artistcountry.py", line 19, in _tmpl_country
artist_item = get_artist_by_id(item['mb_artistid'])
File "/usr/local/lib/python2.7/site-packages/musicbrainzngs/musicbrainz.py", line 808, in get_artist_by_id
return _do_mb_query("artist", id, includes, params)
File "/usr/local/lib/python2.7/site-packages/musicbrainzngs/musicbrainz.py", line 711, in _do_mb_query
return _mb_request(path, 'GET', auth_required, args=args)
File "/usr/local/lib/python2.7/site-packages/musicbrainzngs/musicbrainz.py", line 400, in __call__
return self.fun(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/musicbrainzngs/musicbrainz.py", line 673, in _mb_request
resp = _safe_read(opener, req, body)
File "/usr/local/lib/python2.7/site-packages/musicbrainzngs/musicbrainz.py", line 486, in _safe_read
raise ResponseError(cause=exc)
musicbrainzngs.musicbrainz.ResponseError: caused by: HTTP Error 400: Bad Request
So the plugin is working now with mbsync, the only downside is that is not possible to ommit a path rename if the album is not available in the mb database, which I think is where the 400 error is coming from.
EDIT: Workaround. Using mbsync did solve the 400 error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.