Commit graph

86 commits

Author SHA1 Message Date
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
9f7aa866bd Use ui.should_write everywhere
There sure are a lot of plugins that want to write metadata!
2015-11-07 13:20:09 -08:00
Bruno Cauet
882844bc77 Echonest conversion command: only use byte strings
Temp file name was unicode, so if other parts of the command were
utf8-encoded non-ascii strings the command would fail (in
beets.util.command_output()). Requesting a temp file with a byte string
path fixes the issue.

Fix #1407.
2015-04-09 18:05:41 +02:00
Adrian Sampson
b477f4a53f Merge pull request #1376 from tomjaspers/config-redacted-fields
Config: new option -r redacts sensitive fields

Conflicts:
	beets/util/confit.py
2015-03-27 22:11:24 -04:00
Tom Jaspers
944d38064d Config: implement redacted fields more idiomatic
- `add_redacted_fields(self, *field_names)` to use argument unpacking
- foo =| bar instead of foo = foo | bar
2015-03-25 14:55:29 +01:00
Tom Jaspers
f4ed3e16b1 Config: Add redacted fields from included plugins 2015-03-24 17:01:33 +01:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01: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
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
a5026100a3 All plugins use unicode_literals
Given that part of them has no test I may have broke them
2015-01-20 16:22:27 +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
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