Commit graph

31 commits

Author SHA1 Message Date
Filipe Fortes
7c607ebf82 Simplify fetching cover art from release group 2013-08-08 10:02:25 -03:00
Filipe Fortes
a4470ace69 FetchArt plugin: Support grabbing album art from MB release group 2013-08-07 19:21:45 -03:00
Adrian Sampson
374e043c3c API/test enhancements for #257
Also, `cautious` defaults to False for backwards-compatibility.
2013-04-27 16:47:42 -07:00
Fabrice Laporte
2dc15a0e2b Use re.search instead of re.match with simplified regex.
Add additional cover_names parameter to art_in_path, and makes 'cover_names' a  plugin config option.
2013-04-27 12:21:57 +02:00
Fabrice Laporte
d9e213867c fetchart (issue 459): use regex to detect valid image names + 'cautious' option for finer control of filename matching 2013-04-22 23:44:35 +02:00
Adrian Sampson
d1e50da71f fetchart: remote_priority config option 2013-02-10 21:40:55 -08:00
Adrian Sampson
99ed9e03de rename ImportTask.path to paths (#89) 2013-02-03 11:22:27 -08:00
Tai Lee
23cd5453d9 Improved multi-disc album detection.
- Remove "part", "volume", "vol." multi-disc markers. These are often
  part of album titles, and not necessarily indicative of a multi-disc
  album. Only look for "CD X" and "disc X" (case insensitive), ignoring
  white space and other non-word characters.

- Don't only expect each disc to be in a subdirectory of a common parent
  directory, with all siblings belonging to the same release. Also match
  any consecutive siblings (even when the parent contains other albums)
  that are named with the same prefix and multi-disc marker.

- The `albums_in_dir(path)` function now always yields a list of paths
  along with each list of items. `ItemTask.path` is now always a list of
  paths.

- The `displayable_path(path)` function now accepts a list of paths, and
  will join them with "; " by default. This can be changed with the
  `separator` argument.

- The `sorted_walk()` function now does a case insensitive sort on
  directories, but still returns case sensitive results. This allows
  better multi-disc album detection.

- The `art_for_album()` function now takes a list of paths as its second
  argument, instead of a single path.
2013-02-03 23:51:31 +11: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
fbcd1d1c18 merge fixes from master 2012-12-19 12:22:23 -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
0c49db0f11 fetchart: fix exception when source returns None 2012-12-17 23:22:45 -08:00
Adrian Sampson
6c94358b13 begin Confit-ifying plugins in alphabetical order 2012-12-13 12:31:10 -08:00
Adrian Sampson
ffe5d37d78 log unicode string literals (GC-456) 2012-11-06 14:22:36 -08:00
Adrian Sampson
338eb6388e documentation for convert.exe problem (#64)
We currently just document the fact that convert.exe can interfere with finding
ImageMagick's convert binary. We can solve this with a config option easily once
confit is merged.

This also changes the line endings for fetchart.rst back to Unix.
2012-11-01 14:25:46 -07:00
Adrian Sampson
d9974081a7 add extension for proxied images
`urllib.urlretrieve` was using the correct extension in most cases -- I think
when the URL ended with .jpg -- but not in every case. This was leading to files
named just "cover" and not "cover.jpg" or something else sensible. In
particular, proxied URLs don't have .jpg extensions. This generates the filename
manually so the source image always has an extension.
2012-11-01 12:39:02 -07:00
Adrian Sampson
45650a4b64 artresizer: fix argument lists to helper functions
Also added some useful debug logs.
2012-11-01 12:15:51 -07: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
f7677a4b56 fetchart: fix command & use maxwidth (#64)
An earlier commit broke the call to art_for_album here (too few arguments).
I've also now propagated the maxwidth setting for the command to match the
import hook.
2012-11-01 00:19:15 -07:00
Adrian Sampson
e3fe9712d5 fetchart fixes for image resizing (#64)
Fixed a number of issues with the changes to fetchart:
- Remove redundant fetches. This was making the Amazon source download every
  image twice even when art resizing was not enabled!
- Restore local_only switch in plugin hook, which got lost in the shuffle at
  some point.
- Don't replace the original image file in-place; use a temporary file instead.
  This would clobber the original source image on the filesystem with the
  downscaled version!
2012-11-01 00:09:35 -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
447454a62c fix few errors revealed by test_art.py 2012-10-28 23:02:45 +01:00
Fabrice Laporte
d271735dd2 fetchart: fix urlopen call 2012-10-28 17:09:39 +01: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
57e66d7b1a fetchart: sort image filenames (GC-452) 2012-10-25 18:02:22 -07:00
Adrian Sampson
701d8cf204 fetchart: fix extension-less files from CAA 2012-08-02 09:46:57 -07:00
Adrian Sampson
6503e85a57 fetchart: autofetch option
This necessitated a slight refactoring in the plugin event handling mechanism.
Rather than loading all handlers up front and storing them in a module-scope
structure, we now scan for event handlers at every send(). This is probably
very slightly less efficient but allows for more flexible logic.
2012-06-24 19:01:19 -07:00
Adrian Sampson
fbb5823541 fetchart: command to manually download art 2012-06-24 18:27:00 -07:00
Adrian Sampson
77cbb19564 fetchart: get local art for as-is imports (GC-339) 2012-06-24 17:41:37 -07:00
Adrian Sampson
d807b3fbf1 Cover Art Archive support (GC-71) 2012-06-24 16:57:04 -07:00
Adrian Sampson
11d4fb1abb move album art fetching to a plugin (fetchart) 2012-06-24 00:34:50 -07:00
Renamed from beets/autotag/art.py (Browse further)