Commit graph

6487 commits

Author SHA1 Message Date
Bruno Cauet
c8d24c748e Import unicode_literals in beets.util
The hardest conversio is (by far) functemplate. It will also reguire a
great length of adaptation for python3, since the grammar of the
language changes and several functions (such as ast.arguments and
ast.FunctionDef) take additional mandatory parameters that don't exist
in python2.
2015-01-19 14:53:05 +01:00
Heinz Wiesinger
c86a5f9d97 Make tracktotal an item-level field.
This fixes tracktotal being stored incorrectly for multi-disc releases
where the individual discs have a different number of tracks and
per_disc_numbering is enabled.
2015-01-19 13:02:21 +01:00
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
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +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
Frederik “Freso” S. Olesen
29739dbe04 Move autotag.mb.SEARCH_LIMIT to configuration.
Merge branch 'search-limit-in-config'

From pull request #1245 by @Freso.
2015-01-19 11:46:05 +01:00
Frederik “Freso” S. Olesen
20213c8916 Add changelog entry for new musicbrainz.searchlimit option. 2015-01-19 11:44:16 +01:00
Bruno Cauet
d5e3ff2f48 Improve repr(ConfigView): fix class name displayed
Use config.__class__.__name__ instead of "ConfigView" in __repr__().

Before:
>>> from beets import ui
>>> c
<ConfigView: root>
>>> c['foo']
<ConfigView: foo>

After:
>>> from beets import ui
>>> c
<LazyConfig: root>
>>> c['foo']
<Subview: foo>
2015-01-19 10:42:00 +01:00
Bruno Cauet
70ef96d565 Make list(ui.config) raise a TypeError
As per PEP234 (https://www.python.org/dev/peps/pep-0234/) if an object
has __getitem__() but not __iter__() then the former will be used to
build an iterable, invoking it with 0, then 1, ... until a KeyError is
raised. Lazy configuration makes it never happen, and list(config) runs
indefinitely, hogging all memory.

Implement __iter__(), which raises a TypeError, to solve that problem.
2015-01-19 10:35:32 +01:00
Frederik “Freso” S. Olesen
ad00c5dc7b docs: Fix hyperlink targets.
I inserted musicbrainz.searchlimit at the wrong place, breaking the
hyperlink target `match-config` - and I also forgot to add a hyperlink
target for `searchlimit`.
2015-01-19 02:24:32 +01:00
Frederik “Freso” S. Olesen
7c429e8c58 docs: New entry for musicbrainz.searchlimit config option. 2015-01-19 02:19:43 +01:00
Frederik “Freso” S. Olesen
cef0d2cfd7 autotag: Move mb.SEARCH_LIMIT to configuration. 2015-01-19 02:15:27 +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
Adrian Sampson
dc5a79e35c New import_task_created event
Part of #1186.
2015-01-18 15:37:48 -08:00
Adrian Sampson
f145e3b184 More comment cleanup
It has been a while since I have looked at these, and many of the FIXMEs no
longer make sense to me. Better to open issues if there's really something to
fix.
2015-01-18 14:58:08 -08:00
Frederik “Freso” S. Olesen
167abda752 Merge branch 'master' of https://github.com/sampsyo/beets
Conflicts:
	docs/changelog.rst
2015-01-18 23:05:23 +01:00
Frederik “Freso” S. Olesen
5060fc34ea Changelog for classical genres in lastgenre plugin. 2015-01-18 23:03:50 +01:00
Adrian Sampson
9352927a0f Merge branch 'master' of github.com:sampsyo/beets 2015-01-18 14:00:37 -08:00
Frederik “Freso” S. Olesen
6031cab891 lastgenre: Add "mass" to the classical genre tree. 2015-01-18 23:00:27 +01:00
Frederik “Freso” S. Olesen
61797e7a74 lastgenre: Add classical music.
Merge branch 'Horla-master'

From pull request #1240 by @Horla. Fixes #1239.
2015-01-18 22:54:19 +01:00
Adrian Sampson
90e4a78d94 Move archive logic to ImportTaskFactory
Also move sentinel generation there.
2015-01-18 13:46:56 -08: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
b7125e4343 Centralize some counting in ImportTaskFactory
Part of a larger effort to simplify read_tasks for plugin interposition
(#1186).
2015-01-18 13:03:36 -08:00
Malte Ried
0afe0a60a1 Instead of using the list of archive tasks for further importing, only the fist task was used - which is not iterable, of course. 2015-01-18 19:16:51 +01:00
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