Commit graph

75 commits

Author SHA1 Message Date
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
Bruno Cauet
8165dec985 Delete manual formattings of album & item 2015-01-25 21:32:22 +01:00
Bruno Cauet
62cd6e37aa Update ui.print_obj_(), add ui.format_()
Code now relies on `format()` for items and albums displaying/logging.
`ui.print_()` calls `unicode()` or `str()` on the strings so for most
usages calling `ui.print_(obj)` replaces `ui.print_(obj, lib, None)`.

Where there is a special format `ui.print_(format(obj, fmt))` is fine,
but when `fmt` can be None then one has to call
`ui.print_(ui.format_(obj, fmt))` -- which is what `ui.print_obj` now
does.
2015-01-25 21:07:03 +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
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
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
e14a54df05 Convert multiple plugins' logger usage (easy ones)
Those plugins only called methods and no function, which eases the
conversion.
2015-01-06 21:34:13 +01:00
Bruno Cauet
427f7e7035 Automatic logger level changes on import
Breaking changes: plugins should set set _import_stages instead of
import_stages. From outside the latter is replaced by import_stages().
This is because it is now wrapped with log level-getting & -setting
statements.
2015-01-06 21:27:15 +01:00
Bruno Cauet
b8211a3c4c Every plugin uses its own logger
logging.getLogger(__name__) everywhere!
Several loggers prefixed every log message with [logername], which we
delete here.
2015-01-06 10:35:44 +01:00
Bruno Cauet
30f158a95e Move "from beets import logging" statements
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Bruno Cauet
f5c5666729 Attain pep8-cleanliness
No more E12 or E501
2015-01-04 17:29:31 +01:00
Bruno Cauet
7df8bef8b7 Update logging imports: logging → beets.logging 2015-01-04 17:02:27 +01:00
Bruno Cauet
8cac47af2a Convert beets plugins to lazy logging 2015-01-04 17:02:27 +01:00
Adrian Sampson
1448eab642 Parenetheses-less tuples 2014-12-02 18:12:21 -08:00
Thomas Scholtes
66b81ed081 echonest: test conversion failure 2014-12-02 11:54:36 +01:00
Thomas Scholtes
c248a71494 echonest: mock convert and truncate commands 2014-12-02 11:51:18 +01:00
Thomas Scholtes
f4fdd66b81 echonest: truncating a file converts it to OGG
Previously ffmpeg would throw an error because the file extension is
'.ogg' but the codec is 'copy'.
2014-12-02 11:15:46 +01:00
Thomas Scholtes
5633f50f27 echonest: extract logic into prepare_upload method
Also fixes a bug where both converting and truncating would leave a
temporary file.
2014-12-02 09:58:56 +01:00
Adrian Sampson
d97b90d363 Merge branch 'master' of github.com:sampsyo/beets 2014-12-01 11:28:57 -08:00
Thomas Scholtes
17117ed4ae echonest: Remove temporary files
Fixes #979.
2014-12-01 17:53:14 +01:00
Adrian Sampson
5fb4003ebe echonest: Fix #896 (handle missing duration) 2014-11-30 12:21:27 -08:00
Adrian Sampson
7c08830113 Remove Echo Nest fingerprinting (fix #1121) 2014-11-30 12:18:43 -08:00
Adrian Sampson
590b106ed0 echonest: Fix #1096: log error on repeated error 2014-11-16 12:08:07 -08:00
Thomas Scholtes
d4f72f62eb echonest: set types for flexible fields
Conflicts:
	beetsplug/echonest.py
2014-09-14 12:34:46 +02:00
Adrian Sampson
af3bdd8a66 echonest: Log on retries (for mersault_) 2014-08-11 16:52:37 -07:00
Pedro Silva
8aec50ff8c call truncate, not convert, when truncating 2014-04-14 15:39:36 +02:00
Pedro Silva
cf2f78ef55 fix #685: truncate files larger than 50MB for upload
The new behavior is as follows:

1. If the file size is greater than 50MB, and the 'truncate' config
option is 'no', skip the file.

2. If the file size is greater than 50MB, and the 'truncate' config
option is 'yes', reencode the file to ogg, and truncate to first 5
minutes.
2014-04-14 10:00:54 +02:00
Adrian Sampson
e5a9db1cac fix up some indentation warnings in plugins 2014-04-13 17:55:49 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Thomas Scholtes
c01fc542ed Support for initial_key with EchoNest 2014-04-11 21:03:11 +02:00
Thomas Scholtes
c3ea1ded30 Add item.try_write() to log errors
Many commands and plugins use `item.write()` to update tags. Since the success
of the call is not critical to the functionality of most consumers we want to
catch any exceptions, log an error and continue with our task. The new method
encapsulates this logic.

This fixes #675.
2014-04-10 15:26:05 +02:00
Adrian Sampson
c5174b3881 use command_output utility in echonest
That's the last direct use of the subprocess calls.
2014-04-03 19:51:50 -07:00
Adam M
e30a776baa fix iteration over keys instead of values 2014-03-08 22:10:37 +00:00
Adrian Sampson
ef36890a4e changelog and code simplification for #594 2014-03-08 13:58:37 -08:00
Adam M
c09b86db9c don't iterate over all items to calculate max_bpm
https://github.com/sampsyo/beets/pull/594#issuecomment-37108627
2014-03-08 21:17:37 +00:00
Adam M
dfe8280ff2 add format option to echosim command 2014-03-08 16:22:50 +00:00
Adam M
a0faa530f9 convert echonest bpm to value between 0-1 2014-03-08 16:12:29 +00:00
Adam M
1e7fc76817 add threshold option to echosim command 2014-03-08 15:35:20 +00:00
Pedro Silva
bf7e04af0f fix #562: fail on empty code and handle analyze exceptions 2014-03-02 14:10:52 +01:00
Adrian Sampson
661e82fdec echonest: remove confusing length output (#545) 2014-02-17 22:57:37 -05:00
Adrian Sampson
7190964e05 restore echonest fetch command (fix #540) 2014-02-11 09:44:02 -08:00
Adrian Sampson
4c5fc8fd76 echonest: use only one plugin class (fix #536) 2014-02-10 22:08:15 -08:00
Heinz Wiesinger
7158f7aefc Make sure bpm values coming from echonest are stored as integers. 2014-01-05 20:21:04 +01:00
Adrian Sampson
938563e287 echonest: get audio_summary in search (fix #481) 2013-12-18 12:35:31 -08:00
Adrian Sampson
6ab0abfa90 detect missing echonest fingerprints (fix #477) 2013-12-17 17:18:16 -08:00
Adrian Sampson
d0e53d48b3 echonest: tiny py26 fix 2013-12-12 15:50:08 -08:00
Adrian Sampson
4ea5ed9eed echonest: always flatten results to dict
This avoids the need for two cases (song object or dict) in parts of the code.
2013-11-29 12:58:46 -08:00
Adrian Sampson
5e08c178e6 echonest: fix codegen/identify
I broke two things:
- forgot to return the fingerprint! oops
- need to handle raw Exception raised by pyechonest
2013-11-29 10:09:09 -08:00
Adrian Sampson
9bcd7aecae echonest: clean up FFmpeg-based audio conversion
subprocess.check_call helps a lot here.

--HG--
extra : amend_source : 009a79de8f97407fc60b62aa6b7bd23856286082
2013-11-27 19:09:54 -08:00