Commit graph

277 commits

Author SHA1 Message Date
Serene-Arc
a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
AdrienCos
96b89e77f6 Fix the error with CAA where no image would be downloaded when thumbnails are missing 2023-10-07 23:14:03 +02:00
AdrienCos
e7105a9763 Fix the error with CAA where the pre-sized thumbs of release groups would be ignored 2023-10-07 21:25:02 +02:00
luzpaz
8419149c7a
Fix various typos 2023-08-09 21:26:15 -04:00
wisp3rwind
29c21860a9 add missing syspath conversions (2/3, beetsplug) 2023-07-16 10:17:40 +02:00
lonebyte
2c3aca23e1
Fix the sorting of fanart.tv covers
fanart.tv uses a string to output the number of likes (see https://fanart.tv/api-docs/api-v3/). In order to sort numerically we need to convert the string into an int.
2023-06-14 20:25:18 +02:00
Alok Saboo
7a9d8f9752 added error handling 2023-05-26 08:40:15 -04:00
Alok Saboo
0f1add8b02 Change to spotify_album_id 2023-05-26 08:31:51 -04:00
Alok Saboo
652877617a Change preposition 2023-05-11 20:17:23 -04:00
Alok Saboo
e4c669adcd Address review comments. 2023-05-11 20:12:32 -04:00
Alok Saboo
16e6a2d490 Merge remote-tracking branch 'upstream/master' into coverarturl 2023-05-07 14:29:04 -04:00
wisp3rwind
f5b20114b4 fetchart: revert a cleanup from 4774 that could break plugins
cf. @arogl's comment 254bb297c8 (commitcomment-111922347)

> Now that this has been merged, external plugins that add to the fetchart plugin now fail with:
>
> ```AttributeError: module 'beetsplug.fetchart' has no attribute 'SOURCES_ALL'``
2023-05-05 20:36:28 +02:00
Alok Saboo
f06c5ed593 Update debug logs 2023-05-02 09:51:45 -04:00
Alok Saboo
27a50ce364 Remove unrelated commits 2023-05-02 09:39:59 -04:00
Alok Saboo
1c21821f4a Added changelog and additional error handling 2023-05-02 08:22:54 -04:00
Alok Saboo
17d1a431bc Merge remote-tracking branch 'upstream/master' into coverarturl 2023-05-02 08:08:17 -04:00
Alok Saboo
45f4ce6f9a Add additional checks to prevent Spotify calls 2023-05-02 08:01:41 -04:00
Alok Saboo
4349c1e489 Update fetchart.py 2023-04-30 08:54:51 -04:00
Alok Saboo
2dc784d3a8 Merge remote-tracking branch 'upstream/master' into coverarturl 2023-04-30 08:51:17 -04:00
wisp3rwind
d236747587 fetchart: add add_default_config() method to sources
in order to move the remaining source-specific code out of plugin
initialization and into the source classes
2023-04-30 10:15:40 +02:00
wisp3rwind
254bb297c8 fetchart: add available() method to sources
in order to move (some of) the source-specific code out of plugin
initialization and into the source classes
2023-04-30 10:04:54 +02:00
Alok Saboo
9944599639 Update fetchart.py 2023-04-29 16:44:20 -04:00
Alok Saboo
456cfd7dae Update fetchart.py 2023-04-29 16:40:10 -04:00
Alok Saboo
2f0d416965 Cleanup 2023-04-29 13:41:51 -04:00
Alok Saboo
7dd9137f92 Update fetchart.py 2023-04-29 13:31:18 -04:00
Alok Saboo
17591c3ffd Update fetchart.py 2023-04-29 13:30:50 -04:00
Alok Saboo
5cdd9b5747 Add to sources_all 2023-04-29 13:27:40 -04:00
Alok Saboo
17d2193c02 Add cover_art_url as fetchart source 2023-04-29 13:19:59 -04:00
Alok Saboo
d4eb3a6b82 Update fetchart.py 2023-04-28 18:05:27 -04:00
Alok Saboo
067a3633d3 Change error handling 2023-04-28 18:02:17 -04:00
Alok Saboo
34fe9344ae change preposition 2023-04-28 08:50:01 -04:00
Alok Saboo
654b57f50a Make beautifulsoup optional 2023-04-28 08:47:32 -04:00
Alok Saboo
036667c51e change variable to lower case 2023-04-27 18:13:39 -04:00
Alok Saboo
18bcadcfdc Add spotify art source 2023-04-27 18:10:09 -04:00
Mark Trolley
13ce920fd1
Fix cover art archive fetching
PR #3748 changed the way cover art is fetched from the cover art
archive, but the manual addition of a `-` to the width suffix that was
needed when the image URI was being constructed manually was not
removed. Because of this the plugin would try to look up the property
under `thumbnails` that didn't exist (for example `-1200` instead of
`1200`), which would fail.
2023-02-17 19:01:20 -05:00
Adrian Sampson
c5e68f5643
Adapt to pycodestyle changes 2022-07-30 19:54:24 -04:00
Arsen Arsenović
0b578a3384
fetchart: add option to force cover format 2021-11-03 13:31:33 +01:00
Piotrek Kochański
1a130059e8 deinterlace option to affect when no other processing
remove interlacing by default when resizing/down-scaling, the
`deinterlace` option is to remove interlace when otherwise no processing
would have happened.
2021-11-01 13:51:57 +01:00
Piotrek Kochański
417ef0d453 Merge branch 'master' of github.com:beetbox/beets into deinterlace 2021-10-31 13:27:00 +01:00
Andrew Rogl
9106b41a50 Remove as many as possible sys.version tests 2021-08-27 10:24:27 +10:00
Piotrek Kochański
d30c8b32b5 Remove unnecessary line break. 2021-08-26 15:02:51 +02:00
Andrew Rogl
ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Piotrek Kochański
0a0719f9ed Add plugin option to store cover art non-progressive. 2021-08-25 22:56:46 +02:00
wisp3rwind
9a6b65351b Merge pull request #3560 from davidswarbrick/master
Album Art Resize to filesize
2021-03-23 12:15:51 +01:00
wisp3rwind
af70b75670 fetchart/artresizer: Improve comments & docstrings, avoid os.stat if
possible

slight enhancements on top of https://github.com/beetbox/beets/pull/3560
2021-03-23 12:04:30 +01:00
David Swarbrick
07b5e69f40 fetchart/artresizer: add max_filesize support (#3560)
Squashed from the PR, relevant commit messages follow below:

Added file size option to artresizer

 - In line with comments on PR, adjusted the ArtResizer API to add
   functionality to "resize to X bytes" through `max_filesize` arg

 - Adjustment to changelog.rst to include max_filesize change to ArtResizer
   and addition of new plugin.

Added explicit tests for PIL & Imagemagick Methods

 - Checks new resizing functions do reduce the filesize of images

Expose max_filesize logic to fetchart plugin

- Add syspath escaping for OS cross compatibility
- Return smaller PIL image even if max filesize not reached.
- Test resize logic against known smaller filesize (//2)
- Pass integer (not float) quality argument to PIL
- Remove Pillow from dependencies
- Implement "max_filesize" fetchart option, including
  logic to resize and rescale if maxwidth is also set.

Added tests & documentation for fetchart additions.

Tests now check that a target filesize is reached with a
higher initial quality (a difficult check to pass).

With a starting quality of 95% PIL takes 4 iterations to succeed
in lowering the example cover image to 90% its original size.
To cover all bases, the PIL loop has been changed to 5 iterations
in the worst case, and the documentation altered to reflect the
50% loss in quality this implies. This seems reasonable as users
concerned about performance would most likely be persuaded to
install ImageMagick, or remove the maximum filesize constraint.
The previous 30% figure was arbitrary.
2021-03-23 12:00:14 +01:00
Aksh Gupta
79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
djl
33b10d60fb
fetchart: Improve Cover Art Archive source. (#3748)
* fetchart: Improve Cover Art Archive source.

Instead of blindly selecting the first image, we now treat all "front"
images as candidates.

This is useful where some digital releases have both an animated cover
and a still image and the animated image is the first image returned
from the API.
2020-09-13 20:27:12 +01:00
Mark Trolley
0f767ffa66 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes, and a thumbnail of
that size exists in the Cover Art Archive, fetch it directly
instead of fetching the full size image then resizing it.
2020-06-28 17:18:42 -04:00