Commit graph

2108 commits

Author SHA1 Message Date
Adrian Sampson
494990a7a2 Merge pull request #1322 from tomjaspers/import-metadata-source
Set importer metadata source as field
2015-02-15 09:45:12 -08:00
Tom Jaspers
1555d3fe17 Importer metadata source is saved as flex attr
Saving a file "as is" keeps the data_source attribute unset
2015-02-15 17:46:00 +01:00
Adrian Sampson
296c2fc3de Merge pull request #1325 from brunal/master
Delete 'format' variables that shadow the built-in
2015-02-13 17:50:46 -08:00
Adrian Sampson
b80713ce5b Lambda-free reference to instance method
Amends 9cdd541943, the fix for #1326.
2015-02-13 17:37:55 -08:00
Tom Jaspers
9cdd541943 Error handling for 'filesize' field
- Logs a warning and returns 0 if getsize fails
- Add tests for this

Fix #1326
2015-02-13 12:24:21 +01:00
Bruno Cauet
d267741ff3 Delete 'format' variables that shadow the built-in
Also cleanup the 'the' plugin a bit: delete unused variables.

Relates to #1300.
2015-02-11 16:26:16 +01:00
Tom Jaspers
228e5c0432 Importer metadata source is set as a field
TrackInfo and AlbumInfo were already keeping track of this,
so just had to add it as an actual field to Item and Album

See #1311
2015-02-10 18:17:37 +01:00
Bruno Cauet
7476d6be46 InvalidQuery*Error extend ParsingError
And InvalidQueryArgumentTypeError does not extend TypeError anymore.
2015-02-09 19:25:23 +01:00
Bruno Cauet
f443e0bfc5 InvalidQueryArgumentTypeError does not extend InvalidQueryError
Places where InvalidQueryArgumentTypeError may be raised (i.e. all
current ones) may not know the query therefore it cannot be an
InvalidQueryError. The InvalidQueryArgumentTypeError is caught in
beets.library.Library._fetch() and an InvalidQueryError is then raised.

Improve #1290.
2015-02-09 15:44:49 +01:00
Bruno Cauet
54887e7655 Widen usage of InvalidQueryError
Replace previous InvalidQueryError with InvalidQueryArgumentTypeError
which extends the former as TypeError. However they lack context: the
query that caused the error.

Raise an InvalidQueryError when a shell-like expression cannot be parsed
by shlex.

Improve #1290.
2015-02-09 15:28:06 +01:00
Tom Jaspers
bbc6d0906b Merge pull request #1312 from tomjaspers/album-path-queries
Album path queries get constructed properly

Fix #1307
2015-02-08 16:43:55 +01:00
Adrian Sampson
66b7e4cd39 Merge branch 'master' of github.com:sampsyo/beets 2015-02-07 12:52:20 -08:00
Adrian Sampson
e7f8a627e9 Style fixes for pep8 1.6 2015-02-07 12:51:54 -08:00
Tom Jaspers
3ec44aab3e Update _types field instead of assigning it
Assigning it would override our pre-defined types
(such as `path` in Album._types)
2015-02-06 10:42:46 +01:00
Tom Jaspers
049aa2f297 Album path queries get constructed automatically
Ensures that relative path queries also work for -a mode
2015-02-06 10:38:41 +01:00
Tom Jaspers
80c96d98de Oops, flake8 formatting 2015-02-05 10:54:42 +01:00
Tom Jaspers
d8ebc71f98 Auto path detection: use clearer variable name
Per sampsyo's suggestion

See #1302
2015-02-05 09:47:30 +01:00
Tom Jaspers
5d49b24ea1 Automatic path query detection on album queries
- Path detection happens regardless of the model class
- PathQuery can now match flexattr (in fast-mode)

Fix #1302
2015-02-04 12:55:55 +01:00
Adrian Sampson
82e89b8960 Merge pull request #1292 from mried/import-autosingleton
Allow plugins to change the created import tasks
2015-02-03 09:49:13 -08:00
Malte Ried
11b446e7df Simplified the flattening for the lists returned by plugins on the import_task_created event. 2015-02-03 12:15:17 +01:00
Tom Jaspers
1341ad9b1d Importer UI: Display number of missing/unmatched tracks
Fix #1088
2015-02-03 10:23:52 +01:00
Adrian Sampson
bb967dd629 Merge branch 'master' of github.com:sampsyo/beets 2015-02-02 15:29:52 -08:00
Adrian Sampson
1b22f122a8 Binary literals in unique_path (fix #1298) 2015-02-02 15:28:44 -08:00
Tom Jaspers
6ed0b2e0f3 Expose an Item's filesize as a field
- Update test-case for info to make sure the item's path is pointing to an actual file.

See #1291
2015-02-02 21:52:23 +01:00
Malte Ried
e681449785 Added documentation
FileFilterPlugin uses the new return value feature
Some tweaks to get the code more readable
2015-02-01 17:01:06 +01:00
Malte Ried
754a90dc90 Merge branch 'master' into import-autosingleton 2015-02-01 16:12:59 +01:00
Thomas Scholtes
51ab099145 Extend item.write() to embed images without changing item
Fixes #1241 and geigerzaehler/beets-check#14

Before, `embed_item` would add the images to the item and then call
`item.write()` to write the item data, including the image, to the
file. This would trigger `item.store()` in the `after_write` hook of
the check plugin. This would in turn try to persist the temporary
`images` attribute of the item, resulting in an SQL error.
2015-02-01 15:35:24 +01:00
Tom Jaspers
43e9044843 Duplicate album-import summary shows old/new filesize
E.g.:
Old: 13 items, MP3, 256kbps, 44:32, 101MB
New: 13 items, MP3, 320kbps, 44:31, 128MB

Fix #1291
2015-01-31 22:11:43 +01:00
Adrian Sampson
8b5d43b32e Merge branch 'master' of github.com:sampsyo/beets 2015-01-31 11:56:39 -08:00
Adrian Sampson
614fbf20ca Tests for #1285: parameterize tests
Also remove an errant `print` and use `rb''` literals for regexes.
2015-01-31 11:24:27 -08:00
Bruno Cauet
f284d8fad5 Handle shlex parse errors in query strings
Provide context: offending query string.
Update changelog.
Fix #1290.
2015-01-31 19:54:07 +01:00
Bruno Cauet
e99adddb11 Importer: byte strings for multi-disc directories
Make regexes from raw byte strings and not unicode.
Update the tests.

Fix #1285
2015-01-31 15:40:49 +01:00
Bruno Cauet
557330e994 Fix open numeric ranges
Also improve InvalidQueryError message and update
NumericQuery._convert() docstring.

Fix #1288.
2015-01-31 14:21:32 +01:00
Malte Ried
a608a5fc36 Plugins are able to return a list of import tasks to create instead of the original import task using the import_task_created event. Needed for #1167 2015-01-31 12:41:01 +01:00
Tom Jaspers
927a53d59b Merge pull request #1281 from tomjaspers/configurable-colors
Colors are now user configurable.

Conflicts:
	beets/ui/__init__.py
	beets/ui/commands.py
2015-01-30 13:48:19 +01:00
Tom Jaspers
0947b8f286 Move color-lookup from config in to the colorize function
The mapping occurs lazily (and only once); now in a more pythonic style
2015-01-30 13:40:55 +01:00
Tom Jaspers
f483012183 Colorize is now to be called with the abstract color_name instead of the color.
E.g., `colorize('text_success', 'hello world')`

To ensure compatibility with 3rd party plugins, a valid color ('red') can still be passed,
but it will be logged.
2015-01-29 14:33:57 +01:00
Adrian Sampson
2496867daf Merge pull request #1272 from tomjaspers/master
Display clear error message when MusicBrainz is unreachable
2015-01-28 11:42:40 -08:00
Bruno Cauet
61c7c837ec Fix byte string management in ui.print_()
Joining byte strings → prefix ' ' with b
2015-01-28 11:13:54 +01:00
Adrian Sampson
790c41a73d write: Do not try to write non-writable fields
Fix #1268.
2015-01-27 15:03:19 -08:00
Bruno Cauet
154917bbd1 Add unicode() for Distance: show the distance 2015-01-27 12:16:40 +01:00
Adrian Sampson
35ba6dedfd Tiny tweaks for #1247 2015-01-26 17:21:45 -08:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Adrian Sampson
e3c127b159 Changelog and slight reformatting for #1269 2015-01-26 15:14:45 -08:00
Adrian Sampson
94020963d2 Merge pull request #1269 from brunal/libmodels-formatting
Automatic formatting for Album & Item
2015-01-26 15:12:06 -08:00
Bruno Cauet
4aba4320e6 Rollback ui.print_() auto-conv of args to string
Since this raises problems the best is probably to maintain the base
behaviour: expect byte strings or unicodes.
2015-01-26 23:47:12 +01:00
Bruno Cauet
4e904c78af Simplify LibModel format management
Delete `ui.format_` and then `ui.print_obj`. Simply ensure that when
there is no format it defaults to '' = default format = config option.
2015-01-26 23:09:56 +01:00
Tom Jaspers
e7f3987b42 Centralize check and string literal into MusicBrainzAPIError.__init__ for #1190 2015-01-26 22:19:02 +01:00
Adrian Sampson
da019c75e3 Fix logging of MusicBrainz errors
Eager formatting was actually causing a failure because it looked like a
template string with an invalid substitution group.
2015-01-26 12:10:06 -08:00
Tom Jaspers
d3fce35481 Colors are user configurable
- Colors are mapped on to a dictionary using abstract names (e.g., text_success)
- Add `colors` option under `ui` to allow users to choose their own color scheme
- Move configuration option `color` from top-level to `ui`
- Show deprecation warning if top-level `color` configuration is used (but respect it)

Fix #1238
2015-01-26 17:24:32 +01:00