-
Notifications
You must be signed in to change notification settings - Fork 1
arttools
This plugin adds a whole toolbox to deal with cover art.
Warning: This plugin is currently under development. Things might change without noted anywhere.
To load the plugin just add arttools
to your plugins
configuration.
There are some basic concepts and assumptions which are used through the whole plugin.
The plugin tries to classify the art into two categories: good and bad. Therefore two simple rules are taken:
- Greater (in pixels) the images are better than smaller
- Squared images are better than unsquared (hence the aspect ratio is near 1.0)
One can configure the minimum size and aspect ratio using the configuration using the size_thresh
(defaults to 200 pixels) and aspect_ratio_thresh
(defaults to 0.8) configuration option. When checking the size, the smaller dimension is used so an image with a size of 190x210 pixels is considered as bad because the smaller side is less than 200 pixels. The aspect ratio as always calculated such the result is lower than or equal to 1.0. That means two images with a size of 200x300 and 300x200 have the same aspect ratio.
Art files can be associated to an album. They are called bound art here. To choose the best art, it is necessary to have more than one art file. They have to be placed inside the album folder and named like the following:
- Names configured with the configuration option
additional_names
of thearttools
section. Defaults to an empty list. - Name configured with
art_filename
. Defaults tocover
. extracted
fetched<Source>
A lot of commands for various purposes are added. Every command takes a query to specify which album is affected. Note that all commands work with albums not single items. To test which album will match a specific query one can use beet ls -a <query>
.
-
beet listboundart [QUERY]
: Prints a list of file names and paths to the art files bound to the albums matching the given query. -
beet listbadboundart [QUERY]
: Prints a list of file names and paths to the art files bound to the albums matching the given query which are considered as bad. -
beet listart [-v] [QUERY]
: Prints a list of file names and paths to all found art files. Adding-v
(or--verbose
) to the command will add information about the size of the image and the resulting aspect ratio. -
beet copyboundart -d <PATH> [-p] [QUERY]
: Copy all bound art files into a single directory specified with-d
. The files will be named using the template$albumartist - $album
. Adding-p
(or--pretend
) will only print the files to copy without actually copying them. -
beet chooseart [-p] [QUERY]
: This command tries to figure out which art file is the best one and bound it to the album. Adding-p
(or--pretend
) will only print the files which would be chosen without changing anything. Three values are take into consideration to choose the best art: The aspect ratio (greater is better), the size in pixels (greater is better) and the size in bytes (greater is better). One can change the weightings of these values using the configuration file. Add a subsection calledchooseart_weightings
and add the following weightings within:aspect_ratio
,pixels
andbytes
. The default values are1
for the aspect ratio,0.8
for the size in pixels and0.2
for the size in bytes. -
beet deleteunusedart [-p] [QUERY]
: After you ranchooseart
, all art files are still present. To remove the ones which are not bound to the album, use this command. Only art files matching the configured names will be removed. Adding-p
(or--pretend
) will only print the files to delete without doing so. -
beet artcollage -o <PATH> [-s <SIZE>] [QUERY]
: Takes the bound art of all matched albums and creates a collage of them. The command tries to create square image if possible. It takes two options:-o
(or--out
) specifies the output file name and path and-s
(or--size
) which defines the size of a single album art inside the collage in pixels. The latter one may be set via configuration file using thecollage_tilesize
option. -
beet collectart [-vf] [QUERY]
: Use this command to collect as much art as possible. It utilizes theembedart
andfetchart
plugin to extract embedded cover art and download them from the web, so the requirements of these plugins needed when this command is used. To get a verbose log output, add the option-v
(or--verbose
) to the command. Specifying-f
(or--force
) will extract and download the art even if a corresponding file is already present at the album folder. The cover art extraction can be disabled by setting thecollect_extract
configuration option toFalse
. To specify which sourcesfetchart
should query, use thecollect_fetch_sources
configuration option. It defaults to all possible values for thesources
configuration option of thefetchart
plugin. The command will create image files namedextracted
andfetched<Source>
within each album folder. The first ones are extracted from media files, the latter ones are those fetched by thefetchart
plugin (<Source>
will be replaced by the actual source the image is fetched from). -
beet webchoose [-d]
: Starts the build-in webserver to provide a site to choose from different cover arts manually. Specifying the-d
switch will start the server in debug mode which is what you probably don't want. The server may be configured using thehost
andport
config options within the beets configuration file. The first describes the hostname or IP address to bind on, whereas the latter one specifies the port. After starting the server, a message will be printed how to reach the server. One word of warning about the webchoose function: The UI might be a bit fragile since it is a very early version. Feel free to improve it or file some issues!