Commit graph

167 commits

Author SHA1 Message Date
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
45db930457 embedart: restore an apparent typo (which wasn't)
hashes → phashes
2015-01-05 07:59:53 +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
Michael Ludwig
c76f8bee46 embedart: Added syspath call to art exists check 2014-12-21 13:08:02 -05:00
Thomas Scholtes
9d3729dc5e mediafile: Test deleting images and implement it for MP3s 2014-12-01 17:20:16 +01:00
Adrian Sampson
69b7d1f160 Changelog for #1036 (fix #1028) 2014-10-28 11:50:36 -07:00
kerobaros
3a56077b0c Fixed logic error, added a .get(bool). 2014-10-27 21:20:26 -05:00
kerobaros
f782dfd376 I'll get used to this git thing one day. Cleaning up. 2014-10-24 21:36:30 -05:00
kerobaros
d06da6381f Updating to master to form a new PR. 2014-10-24 21:33:09 -05:00
Adrian Sampson
a7b7e23436 Minor fixes for #1033 2014-10-24 16:46:55 -07:00
kerobaros
9a191baca4 Working on issue #1028, resize images only once per album. 2014-10-24 15:01:52 -05:00
kerobaros
ca431b0bf8 Seperated some code out from extract() into get_art(item). Cleaner and quicker way to check for embedded art. 2014-10-23 22:37:19 -05:00
kerobaros
7f37514bb9 Whoops, trailing space. Take 2. 2014-10-23 21:17:42 -05:00
kerobaros
9be753736b Slight style tweaks. 2014-10-23 21:13:30 -05:00
kerobaros
e06f492f91 Whoops, take two. 2014-10-23 15:31:38 -05:00
kerobaros
75b62b723f Added "ifempty" config to embedart plugin, re: issue 1020 2014-10-23 15:27:15 -05:00
Adrian Sampson
7754fe5a40 embedart: Fix logging during import (#1014)
Regression introduced in 2813cd26c1.
2014-10-14 09:42:11 -07:00
Adrian Sampson
b777bde0af Fix #1006: errant info-level log
Introduced in e99df7bc65.
2014-10-11 15:05:01 -07:00
Adrian Sampson
983aac287b Add a displayable_path call in embedart (fix #995) 2014-10-09 11:13:39 -07:00
Adrian Sampson
d17c148e52 Minor fixes, changelog for #974 2014-09-25 15:33:52 -07:00
Fabrice Laporte
d2cf41fc70 restore command_output() implementation as of 0ec285f 2014-09-22 13:49:23 +02:00
Fabrice Laporte
c1224caab5 Merge branch 'fetchart_issue848'
Conflicts:
	test/test_embedart.py
2014-09-21 14:23:59 +02:00
Fabrice Laporte
1c2448c3e0 add can_compare flag to ArtResizer 2014-09-20 12:19:10 +02:00
Thomas Scholtes
1e45ba597d embed_item function does not raise if image file not found
Fixes #968
2014-09-18 16:19:05 +02:00
Fabrice Laporte
1bffe2a7bf obey Travis orders 2014-09-17 22:57:38 +02:00
Fabrice Laporte
e99df7bc65 embedart: add compare_threshold option
if compare_threshold > 0 we call check_art_similarity to return sooner
if it happens that candidate image and embedded one are similar.
2014-09-17 22:01:08 +02:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
66aee8094f Clean up of logging messages as described here
All logging now prefers the ' (single quote) over the " (double quote)

https://github.com/sampsyo/beets/wiki/Hacking
2014-09-09 11:28:43 +10:00
Adrian Sampson
7de6259c1d MediaFile: make id3v23 a constructor parameter
For #899, we need to change MediaFile's behavior (pre-write) based on whether
we're doing ID3v2.3 or not. So we need a field on the object, not a parameter
to `save()`.
2014-08-15 12:09:18 -07:00
Thomas Scholtes
2813cd26c1 Refactor embedart to work at item level
Embedding images now triggers the `*_write` plugin events. This
allows *beets-check* to update the checksum. See the [beets-check
issue][1].

[1]: https://github.com/geigerzaehler/beets-check/issues/7
2014-06-02 17:10:48 +02:00
Thomas Scholtes
9090f0979f Use new _embed api 2014-04-26 19:44:29 +02:00
Thomas Scholtes
9b88525736 Make function to embed art agnostic of items 2014-04-26 19:41:44 +02:00
Thomas Scholtes
73a1b63f7d Catch and log file errors when embedding images
Fixes #723.
2014-04-25 12:33:19 +02:00
Adrian Sampson
e5a9db1cac fix up some indentation warnings in plugins 2014-04-13 17:55:49 -07:00
Adrian Sampson
fb37be44db restore some comments from #684
I wanted to leave a few of these as comments -- they serve more as separators
than as internal documentation.
2014-04-13 17:43:43 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Adrian Sampson
33b44717ab embedart: catch log errors (fix #678) 2014-04-10 11:24:59 -07:00
Adrian Sampson
443b8089d5 remove unnecessary IndexableEnum
This is not really critical since list(Type)[i] works just as well. This fixes
a couple other problems from the enum transition:
- The name of TYPES was not really consistent with its new role as an enum
  type. Renamed this ImageType.
- Fix a rather egregious bug in embedart (undefined reference to Image).
2014-04-08 16:59:50 -07:00
Thomas Scholtes
071a5c363d Use new MediaFile api to embed art 2014-04-08 01:41:26 +02:00
Chris Cogburn
d0c3cb5779 Fix for id3v23 to include config parameter to save 2013-11-05 21:27:26 -06:00
Adrian Sampson
19958f75ff embedart: fix error message when imagehdr fails 2013-09-12 10:45:02 -07:00
Lucas Duailibe
51ed0939d6 fixing things 2013-03-25 15:20:38 -03:00
Lucas Duailibe
56c53acbab human-friendly error messages (#125) 2013-03-25 11:24:42 -03:00
Adrian Sampson
f8d6e84581 invert new embedart switch (#182)
The default behavior now does what most people probably expect, which is to
run like the on-import handler for the embedart plugin.
2013-03-17 22:50:28 -07:00
Lucas Duailibe
0c53c0bc3f option to embed current album arts (closes #182) 2013-03-17 22:52:51 -03:00
Adrian Sampson
6898d95b9e allow convert to be used without embedart enabled 2013-01-23 15:56:49 -08:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
6d68a4855e per-plugin configuration defaults in __init__()
This uses the new BeetsPlugin.config convenience view heavily. Things are
slowly getting less verbose.
2012-12-18 22:35:44 -08:00
Adrian Sampson
6c94358b13 begin Confit-ifying plugins in alphabetical order 2012-12-13 12:31:10 -08:00
Adrian Sampson
07d3f3e066 lazily initialize ArtResizer singleton (#64)
Searching for `convert` or PIL has non-negligible performance overhead, so it's
preferable to only do it when really necessary. This way, the search is only
performed when ArtResizer.shared is accessed for the first time.
2012-11-01 11:40:53 -07:00
Adrian Sampson
3873c29448 artresizer (#64): helper functions, not classes
The previous method was to change self.__class__ dynamically to make __init__
instantiate different classes. This new way, which uses bare functions instead
of separate functor-like classes, instead just forwards the resize() call to
a module-global implementation based on self.method.

Additionally, the semantics of ArtResizer have changed. Clients now *always*
call resize() and proxy_url(), regardless of method. The method makes *one* of
these a no-op. This way, clients need not manually inspect which method is
being used.
2012-10-31 23:33:59 -07:00
Fabrice Laporte
7f2aa44ac6 Add 'maxwidth' option to embedart and fetchart plugins.
artresizer.py instances an ArtResizer object that uses internally the PIL; ImageMagick
or a web proxy service to perform the resizing operations.
Because embedart works on input images located on filesystem it requires PIL or ImageMagick, whereas
fetchart is able to do the job with the fallback webproxy resizer.
2012-10-28 15:36:42 +01:00
Adrian Sampson
66e75c398d embedart: log & skip unreadable audio files 2012-05-21 10:47:17 -07:00
Adrian Sampson
f6b37d2c8c remove with_statement __future__ imports
This is the first of several commits that will modernize the beets codebase for
Python 2.6 conventions. (Compatibility with Python 2.5 is hereby abandoned.)
2012-05-13 20:39:07 -07:00
Adrian Sampson
a1b2b6c8a2 fix plugin hook in embedart 2011-12-28 15:56:07 -08:00
Adrian Sampson
3b2ea5d289 add a missing __future__ import in embedart 2011-07-10 12:07:52 -07:00
Adrian Sampson
fed8782ca1 fix Unicode queries from CLI arguments 2011-07-01 15:43:06 -07:00
Adrian Sampson
fcc2744ac5 use separate shell arguments for queries to preserve whitespace 2011-06-26 00:12:45 -07:00
Adrian Sampson
8341dee3ab reorder items() and albums() parameters to reflect common use 2011-05-05 17:20:24 -07:00
Adrian Sampson
a0e7c70c64 "clearart" command for removing embedded album art 2011-04-27 10:37:46 -07:00
Adrian Sampson
73c4bedc41 simplify MediaFile art interface: no type is included
The interface no longer specifies the type of the image embedded in the file; it
just returns a bytestring blob. When a type must be stored, it is inferred using
the imghdr module, which shoudl reduce the potential for weird bugs when the
formats don't correspond.
2011-04-27 10:27:26 -07:00
Adrian Sampson
2768e71c21 config option for disabling automatic embedding 2011-04-21 01:42:08 -07:00
Adrian Sampson
e8d54af9df NEWS note; check for missing art when extracting 2011-04-21 01:33:56 -07:00
Adrian Sampson
415fe0be31 "embedart" and "extractart" commands 2011-04-21 01:20:50 -07:00
Adrian Sampson
866c662014 use imghdr directly instead of MIME lib (which uses imghdr) 2011-04-21 00:42:16 -07:00
Adrian Sampson
c20ce11a8c update album art embed plugin for new API
--HG--
rename : beetsplug/embedcoverart.py => beetsplug/embedart.py
2011-04-21 00:01:34 -07:00