Commit graph

4846 commits

Author SHA1 Message Date
Bruno Cauet
bcd57bd2b5 Test queries building sort management in smartplaylist
Slighly modify Sort parsing: avoid building MultiplSort() instances
comptised of a single sort, but return that sort instead, since it wraps
things with any gain.
2015-03-18 18:53:41 +01:00
Bruno Cauet
45c0c9b3cb Deal with sorting
Try to follow any sort found & manage absence of sort. When there are
multiple sort directives given, concatenate them.

Tests not extended yet.
2015-03-18 18:09:42 +01:00
Bruno Cauet
65b52b9c48 python 2.6 compat: don't use set literals
In smartplaylist and test_smartplaylist.
2015-03-16 19:42:54 +01:00
Bruno Cauet
7bee2f093b changelog: fix an extra ':' after a bug # 2015-03-16 18:48:28 +01:00
Bruno Cauet
5d1ee0457f Document the smartplaylist plugin updates 2015-03-16 18:47:38 +01:00
Bruno Cauet
191ff61c53 Document the database_change parameter update 2015-03-16 18:44:52 +01:00
Bruno Cauet
b79c025142 CLI tests for smartplaylist plugin
No import CLI test.
2015-03-16 18:36:08 +01:00
Bruno Cauet
8b6b938a37 SmartPlaylistPlugin: add unit tests
They're not exhaustive but still quite heavy.
2015-03-16 18:04:00 +01:00
Bruno Cauet
e00282b4fe Implement hash() for query subclasses
It is implemented on mutable queries as well, which is bad. IMPORTANT:
don't mutate your queries if you want to put them in a set or in a dict
(as keys).
2015-03-16 17:28:00 +01:00
Bruno Cauet
64614ff579 Query.__eq__: fix indents 2015-03-16 17:28:00 +01:00
Bruno Cauet
4151e81969 Implement __eq__ for all Query subclasses
Tests are a bit light.
2015-03-16 17:01:14 +01:00
Bruno Cauet
a1b048f5de RegexpQuery: fix typo: false → fast 2015-03-16 17:01:11 +01:00
Bruno Cauet
40e793cdb1 Fix flake8 errors 2015-03-16 16:25:43 +01:00
Bruno Cauet
774decda7d Smartplayist: parse_query_parts() → ...ry_string() 2015-03-16 16:21:49 +01:00
Bruno Cauet
2d9f665848 Smartplaylist: offer "splupdate <playlist names>"
splupdate command of the SmartPlaylistPlugin looks in "args" for matches
of playlist names.
2015-03-16 16:03:14 +01:00
Bruno Cauet
f06c33cb71 Smartplaylist: update only if item changed 2015-03-16 15:16:40 +01:00
Bruno Cauet
4bfa439ee1 database_change: send model that changed 2015-03-16 14:32:37 +01:00
Adrian Sampson
f6df14a798 Isolate bugs in pylast
Should fix crashes like this:
http://hastebin.com/nizusukuli.log
2015-03-14 15:13:07 -07:00
Adrian Sampson
736eab412c Bytes arguments to bs1770gain command 2015-03-14 14:43:00 -07:00
Tom Jaspers
96a565a614 info: error msg instead of traceback on IOError
IOErrors were previously not caught, displaying full traceback to the user
2015-03-13 17:55:09 +01:00
Bruno Cauet
02855a44bd Fix exception construction in util.command_output()
`cmd` being a byte string array, it should be joined by b" " and not
u" ".
2015-03-13 11:51:26 +01:00
Adrian Sampson
2f7128f1d7 Merge pull request #1353 from guibog/add-log
Add debug log for plugin paths
2015-03-12 08:42:36 -07:00
guibog
295ebc0bc6 Add debug log for plugin paths 2015-03-12 16:01:02 +08:00
Bruno Cauet
e71caded81 Update docs' html_theme value: default → classic
New proposed default is 'alabaster', which looks nice but leaves less
room to the core content. 'classic' replaces 'default'.

Anyway readthedocs.org applies its own theme so this only impacts local
builds.
2015-03-11 11:08:40 +01:00
David Logie
ee6fba1e82 Fix call to add_format_option() missing plugin. 2015-03-08 12:59:00 +00:00
Bruno
f6c6c35614 Merge pull request #1346 from brunal/subcommand-auto-format-path
Generalize --path, --format and --album options
2015-03-07 14:05:05 +01:00
Bruno Cauet
1722c26ffe Fix DiscogsPlugin.setup() arguments
Session is optional. This fixes re-authorization.

Improve #1347.
2015-03-07 14:00:47 +01:00
Bruno Cauet
e789b04c9a Rename LibModel.format_config_key → _format_config_key
Fix #1346
2015-03-07 13:57:12 +01:00
Bruno Cauet
679b0a586b Remove list_format_{album,item} sections from docs 2015-03-07 13:45:58 +01:00
Adrian Sampson
bcc591bf97 Generalize exception handler for #1347 2015-03-06 12:01:09 -08:00
Bruno Cauet
d1f6bbaf01 Discogs plugin: catch client lib ValueErrors
When search fails, log the query which caused it and return an empty
result.

Kind of fixes #1347.
2015-03-06 11:16:20 +01:00
Bruno Cauet
58b39f1000 Merge branch 'master' into subcommand-auto-format-path 2015-03-05 17:53:31 +01:00
Bruno Cauet
167f067961 Improve behavior of --path: store_true-like
Availability of the 'path' presence in arguments can be important for
some plugins such as duplicates, and therefore should be conserved.
2015-03-05 17:40:32 +01:00
Bruno Cauet
6fda0e23fc Update docs & changelog 2015-03-05 17:40:32 +01:00
Bruno Cauet
7798a521b5 Fix convert plugin 2015-03-05 17:40:32 +01:00
Bruno Cauet
ea1dc1eb19 Plugins conversion cont. 2015-03-05 17:40:32 +01:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01:00
Bruno Cauet
38ca99498d Bypass sequential args. parsing for --album
When setting format and using --album we *need* to know whether we're in
album mode. Naively if --album happens after "--format fmt" then we'll
set Item format instead of Album format.
By looking forward for -a/--album we bypass that problem.
2015-03-05 16:42:33 +01:00
Bruno Cauet
5623d26a91 Add tests for the CommonOptionsParser
Unit test both the features & do real behaviour tests with the 'list'
command.
2015-03-05 16:42:03 +01:00
Bruno Cauet
6234fee67d Option parser: add common options with a method
Add a new OptionParser subclass: CommonOptionsOptionParser, which
provides facilities for adding --album, --path and --format options. The
last one is quite versatile.

Update base commands (from beets.ui.commands) to use those.
2015-03-05 15:01:20 +01:00
Bruno Cauet
f14f47f059 Renamed list_format_* into format_* 2015-03-04 16:51:28 +01:00
Bruno Cauet
5a355201d3 test_replaygain: fix except a, b: → except (a, b): 2015-03-04 15:29:19 +01:00
Bruno Cauet
9750351a1b beets.util.command_output() & related receives bytes
- May fail with unicode, esp. will non-ascii system path entry.
- Only send it bytes.
- Also applies to subprocess.Popen() & co.
2015-03-04 15:15:46 +01:00
Bruno Cauet
f8e2ca2c94 Replaygain tests: more careful plugins unloading
When plugins loading as failed plugins unloading may fail in
consequence, swallowing the loading error. This fixes it.
2015-03-04 15:05:22 +01:00
Bruno Cauet
69786b8538 Fix test.helper.has_program(): encode command
subprocess.subprocess.check_call() should receive a byte string command
otherwise it fails with a UnicodeDecodeError on systems with non-ascii
elements in the system path.

Discovered while reviewing PR #1344.
2015-03-04 15:05:17 +01:00
Adrian Sampson
8113c7ba85 Roll back whitespace changes from #1343 2015-03-03 10:41:30 -08:00
Adrian Sampson
48671cbdf1 Changelog for #1343 2015-03-03 10:38:01 -08:00
Adrian Sampson
293e44f61b Merge pull request #1343 from jmwatte/bs1770gainsupport
Bs1770gainsupport
2015-03-03 10:36:00 -08:00
jmwatte
5d7d402adb correct typing error 2015-03-03 13:11:25 +01:00
jean-marie winters
a3e32fd410 added fatalreplaygainerror 2015-03-03 11:23:45 +01:00