Commit graph

1311 commits

Author SHA1 Message Date
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
b436e75a9e embedart: fix behaviour on IM unparseable output, add tests
Test all EmbedCoverArtPlugin.check_art_similarity() code paths.

Improve #1241.
2015-01-19 11:50:51 +01:00
Adrian Sampson
f346853710 embedart: Do not use shell for subprocess
This avoids bugs when the filename contains spaces, etc.

Pinging @Kraymer: I gave this a brief test, but can you check whether I messed
anything up more subtly?

Came up when looking at #1241.
2015-01-18 16:25:23 -08:00
Adrian Sampson
909c96b060 embedart: Handle unparseable IM output (#1241) 2015-01-18 16:18:22 -08:00
Frederik “Freso” S. Olesen
6031cab891 lastgenre: Add "mass" to the classical genre tree. 2015-01-18 23:00:27 +01:00
Horla
587ff39f22 Update genres-tree.yaml
Removing "classic"
2015-01-18 22:46:40 +01:00
Horla
8ed9e50e18 Update genres-tree.yaml
Changing "classic" to "classical"
2015-01-18 22:27:34 +01:00
Horla
3fdc5c936e Update genres.txt
Add classical subgenres
2015-01-18 22:13:36 +01:00
Horla
3a3150b740 Update genres-tree.yaml
Add classic genre with its subgenres
2015-01-18 22:11:01 +01:00
Adrian Sampson
bf02855ee1 Remove Beatport plugin (c.f. #1229) 2015-01-16 12:15:54 -08:00
Bruno Cauet
7c2d5f0948 Import beets.ui in discogs plugin
The discogs plugin uses beets.ui but did not explicitely import it,
which might cause it to crash when used in standalone.
2015-01-16 17:59:35 +01:00
Bruno Cauet
d2726e1c25 Fix mpdstats plugin config management
Fix #1228:
- remove erroneous calls to `self.config`
- always use `config['mpd']` and not `self.config` (which is
  config['mpdstats']) to match the doc
2015-01-16 11:08:24 +01:00
Bruno Cauet
b49cd3b73b Lyrics plugin: fix google backend
Give config on backends init so the Google backend can get the API key
and Engine Id.
Fix #1226
2015-01-15 11:28:04 +01:00
Adrian Sampson
c1ce71f35c smartplaylist: Fix album_query (fix #1225)
This is far less elegant and functional, but at least it is correct.
2015-01-14 22:00:30 -08:00
Adrian Sampson
38c5bb3666 Fix a docstring 2015-01-14 21:53:13 -08:00
Bruno Cauet
0c3675ada0 Fix replaygain: add 'log' to __init__ parameters 2015-01-14 16:17:20 +01:00
Bruno Cauet
0d1fa80651 Smartplaylist: don't utf8-encode the name
A Template expression expects an unicode, not an utf8-encoded string.
Add a test for that.
2015-01-14 12:32:00 +01:00
Bruno Cauet
6408904a8c Smartplaylit: fix log format string
{0.name} → {0[name]} since the argument is a dict.
2015-01-14 12:15:44 +01:00
Bruno Cauet
9a2a9b0144 smartplaylist: fix docstring 2015-01-13 18:53:47 +01:00
Bruno Cauet
ca91bc8920 mpdupdate: fix indent 2015-01-13 18:53:30 +01:00
Bruno Cauet
753388550e Clean PlexUpdate plugin
- no global variable
- use logging instead of prints
2015-01-13 12:36:16 +01:00
Bruno Cauet
de86b9b570 Clean MPDupdate plugin
- no global variable
- use logging instead of prints
- unicode logging
2015-01-13 12:30:40 +01:00
Bruno Cauet
a7beaa6d6e Clean & shorten smartplaylist code
- better log messages
- more idiomatic code: "X not in Y" instead of "not (X in Y)"
- shorten _items_for_query:
    - pre-detect whether it's album_query or query, hiding conf. spec to
      the function.
    - Let library.{items,album} parse the query string, therefore
      falling back to beets-level sort spec. if none is given in the
      query
2015-01-13 12:11:52 +01:00
Bruno Cauet
7c4496c110 Smartplaylist: log messages instead of printing
ui.print_ → self._log.info

Also change config['smartplaylist'] into self.config
2015-01-13 11:42:23 +01:00
Bruno Cauet
fdb768c9db Simplify smartplaylist flow
Suppress the global variable, register listeners if it's needed only.
2015-01-13 11:31:42 +01:00
Bruno Cauet
4babc40fd8 Delete useless "config['mypluginname']" mentions
Replace with self.config where this is painless.
More plugins would benefit from this update but that requires turning
functions into methods.
2015-01-12 10:55:59 +01:00
Adrian Sampson
f871ef9e21 Verbosity affects plugins (#1208)
This restores the -v flag affecting plugins. By default, plugin loggers use
the NOTSET level, which just reuses the base `beets` logger level. The level
is only auto-adjusted for the importer when not in verbose mode.
2015-01-11 15:00:20 -08:00
Adrian Sampson
24317fd4c7 Rename BeetsPlugin._import_stages to import_stages
For #1208. Restores backwards-compatibility and matches the development docs.
2015-01-11 14:27:59 -08:00
Bruno Cauet
b27c5304d1 Merge branch 'master' into logging
Conflicts:
	beetsplug/fetchart.py
	beetsplug/mpdstats.py
2015-01-09 15:15:27 +01:00
Adrian Sampson
558d1f9639 Merge pull request #1212 from brunal/mpdstats-react-only-once
mpdstats: don't register a natural song change twice
2015-01-08 13:43:46 -08:00
Adrian Sampson
1654fc82ce Merge pull request #1211 from brunal/fetchart-check-isfile
Fetchart: check that the art found is a file
2015-01-08 13:40:21 -08:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Bruno Cauet
23e6760e19 Partial rollback of bpd logging 2015-01-08 17:55:40 +01:00
Bruno Cauet
b7735bd3bf Don't register a natural song change twice
mpd responds twice to an 'idle' command upon a 'natural' song change
(i.e. not a skip). Checking the reason for mpd response avoids
registering twice the song change.

Fix issue #773
2015-01-08 12:39:28 +01:00
Bruno Cauet
2e1b0d589d Fetchart: check that the art found is a file
Fixes issue #1177
2015-01-08 10:58:08 +01:00
Bruno Cauet
1ca33a8a52 Avoid using partial() for the listener callback
partial() is not a instance of types.FunctionType so
inspect.getargspec() (used in beets/plugins:422) fails on it.
2015-01-08 10:10:42 +01:00
Bruno Cauet
422a7f6063 replaygain: fix backend instanciation 2015-01-06 22:13:17 +01:00
Bruno Cauet
00d5473187 Merge branch master into logging
Conflicts:
	beetsplug/lyrics.py
2015-01-06 21:46:04 +01:00
Bruno Cauet
b2582c5d62 MusicBrainz collection plugin: delete "print" uses 2015-01-06 21:42:34 +01:00
Bruno Cauet
f504c78681 Fix usage of embedart by convert plugin
Instanciation of EmbedCovertArtPlugin on the fly: there may be several
instances → problem with the listeners it registers?
2015-01-06 21:42:28 +01:00
Bruno Cauet
8097ff8c1d Convert fetchart plugin, with OO rewrite of sources
Art sources are now classes
2015-01-06 21:42:10 +01:00
Bruno Cauet
5c1cc6e7fc Convert the convert plugin to the new logging system 2015-01-06 21:42:10 +01:00
Bruno Cauet
11d5f93db1 Convert importadded plugin
Many listeners. Everything is now a method
2015-01-06 21:42:10 +01:00
Bruno Cauet
63041736e3 Convert lyrics plugin, with OO rewrite of backends 2015-01-06 21:42:10 +01:00
Bruno Cauet
860e7e1483 Update 3 plugins: func → methods, listeners
- functions turn into method in order to have the logger object
- registering the listener has to be updated too
2015-01-06 21:42:09 +01:00
Bruno Cauet
203b325ee7 Convert mbsync logging: big funcs → methods 2015-01-06 21:42:09 +01:00
Bruno Cauet
74e18afa94 Convert bdp: pass around with static setter on classes 2015-01-06 21:42:09 +01:00
Bruno Cauet
32673b87e7 Update multiple plugins: pass the logger around 2015-01-06 21:42:09 +01:00
Bruno Cauet
7d58a38428 Convert replaygain: pass logger to other classes
This time the logger is passed to the other classes of the module, not
to functions.
2015-01-06 21:42:02 +01:00
Bruno Cauet
38352f7058 Update chroma plugin logging: pas logger around
The logger is passed as an argument to multiple function. This showcases
the second possibility for using the new logging system. Several similar
conversions to be expected.
2015-01-06 21:42:02 +01:00