Commit graph

5505 commits

Author SHA1 Message Date
Malte Ried
c91f7f7795 Archive tasks may be a list of tasks instead of a single task now 2015-01-18 19:07:20 +01:00
Malte Ried
0eb185a5e7 Merge branch 'master' into import-filefilter 2015-01-18 18:55:24 +01:00
Tom Jaspers
1a799bb77f Fetchart: update documentation to reflect that Wikipedia is now also used as a source 2015-01-18 15:13:27 +01:00
Tom Jaspers
133c21a9c5 Fetchart: add fetching artwork from Wikipedia following the new class-based structure of the plugin 2015-01-18 15:09:36 +01:00
Andre Miller
9fe2bc1a38 Support for CORS 2015-01-18 10:23:49 +02:00
Adrian Sampson
4169da3dd1 Fix "skipped N directories" message 2015-01-17 19:05:00 -08:00
Adrian Sampson
8a60875086 More docstring fixes in ImportTaskFactory 2015-01-17 19:01:15 -08:00
Adrian Sampson
b273be9d59 Event handlers can now return values
Part of #1186, which I hope to break into smaller pieces.
2015-01-17 18:39:56 -08:00
Adrian Sampson
c392932a92 Improve some docstrings 2015-01-17 18:30:47 -08:00
Adrian Sampson
6f2d9845b5 Add an assertion for summarize_items (#1232) 2015-01-17 14:20:53 -08: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
Adrian Sampson
6fb3b24c31 Merge pull request #1221 from brunal/crash-on-invalid-queries
Stop on invalid queries instead of ignoring them
2015-01-15 10:50:05 -08:00
Bruno Cauet
08c9ad43fa Document the new behaviour in docstrings & changelog 2015-01-15 11:55:42 +01:00
Bruno Cauet
f4b4847919 Rename exception: InvalidQuery → InvalidQueryError
Follow PEP8.
2015-01-15 11:47:35 +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
27eee3829c Merge pull request #1222 from sampsyo/smartplaylist
Update smartplaylist logging & unicode management
2015-01-14 12:47:07 +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
3804eb5b52 Stop on invalid queries instead of ignoring them
So far an invalid query won't be applied:
    $ beet ls The Beatles year:196a
will be treaded as
    $ beet ls The Beatles
With this commit it stops beets, returns 1 and produces
    $ invalid query: u'196a' is not an int or a float
This applies to any querying and therefore on many command, plugins and
some configuration options.
Invalid queries exist on numeric fields and on regular expression usage.

Compile regular expression queries upon instantiation instead of upon
each match test.

The reporting can be improved (give more context). Fix #1219.
2015-01-14 11:28:50 +01:00
Malte Ried
ad65242ebd Merge branch 'master' into import-filefilter
Conflicts:
	beets/importer.py
	beets/plugins.py
	beetsplug/ihate.py
2015-01-14 10:46:03 +01:00
Adrian Sampson
ccd5e71519 Merge pull request #1218 from brunal/no-global-no-print
Clean plugins: no global, no print
2015-01-13 10:37:56 -08: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
82772966c8 Smartplaylist: fix incorrect doc
With auto mode playlists are regenerated *at the end of the session, if
a database update happened*, and not after a database update.
2015-01-13 11:53:39 +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
2e57d8660e Ensure there's no duplicate plugin listeners
A same function cannot be registered twice on a given event.
This will permit improvements of some plugins (e.g. smartplaylist)
2015-01-13 11:29:42 +01:00
Bruno Cauet
c8309cbe57 Simplify BeetsPlugin.listen()
Deduplicate code with BeetsPlugin.register_listener().
2015-01-13 11:11:16 +01:00
Bruno
a86fb19f92 Merge pull request #1217 from brunal/logging
Use a standard logger for the import log
2015-01-13 09:34:19 +01:00
Bruno Cauet
2cf327e0fd beet.importer: remove unnecessary log.info() call 2015-01-13 09:23:55 +01:00
Bruno Cauet
81754e5760 beets.logging exports NullHandler on python 2.6
NullHandler is not available in python 2.6. We backport it so the
importer log can use it for it is more convenient than guarding calls to
self.logger (see beets/importer.py)
2015-01-13 09:20:29 +01:00
Bruno Cauet
cce0a5d81f ImporterSession.tag_log(): improve docstring 2015-01-13 09:12:50 +01:00
Bruno Cauet
621ea60af4 Improve importer log unicode-handling test
Send unicode instead of utf8-encoded string and check that the
non-ASCII char is correctly handled.

Bonus: use unittest.TestCase.assertIn(A, B) instead of "assert A in B".
2015-01-12 22:20:58 +01:00
Bruno Cauet
8418fb6083 Use a standard logger for the import log
The import log now relies on a standard logger, named 'beets.importer'
and configured upon initialization of the import session.
2015-01-12 21:47:44 +01:00
Adrian Sampson
7a49c25e86 Merge pull request #1215 from brunal/clean-config-usage
Delete useless "config['mypluginname']" mentions
2015-01-12 11:09:47 -08: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
34c9caae67 Changelog for logging changes (#1208) 2015-01-11 15:44:38 -08:00
Adrian Sampson
e83b6ae297 Logging (#1208): prefix plugin names, expand docs
We now add the plugin name to messages in verbose mode. This may not be the
best final policy, but it does help make the output more readable when many
plugins are talking at once.
2015-01-11 15:39:54 -08:00
Adrian Sampson
6d5945daa4 Use logger.getChild (#1208)
Let the library do the string formatting for us.
2015-01-11 15:08:42 -08: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
Adrian Sampson
1aa04e4500 Merge pull request #1208 from brunal/logging
Plugins log everything through their `_log` attribute
2015-01-11 14:22:27 -08:00