From 0d21e816d4e75d3556fb2499832ae82b14911d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Tue, 7 Apr 2015 14:54:00 +0200 Subject: [PATCH] Fetchart: Remove hard 500px size limit for CAA cover art. Using -500 URLs for coverartarchive.org will only ever return images where the biggest dimension is (width or height) is 500 pixels, regardless of what fetchart settings are otherwise set. This commit removes the -500 from the URL entirely rather than using it conditionally, since a maxwidth of 500 will allow for a 600 high and 500 wide image, but CAA.org/...-500 would return a 500x417 image instead, so not enforcing a size is the only way to ensure the user's {max,min}width settings are properly respected. --- beetsplug/fetchart.py | 4 ++-- docs/changelog.rst | 2 ++ test/test_art.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 3eaa3d3e8..2be0ed9c0 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -57,8 +57,8 @@ class ArtSource(object): class CoverArtArchive(ArtSource): """Cover Art Archive""" - URL = 'http://coverartarchive.org/release/{mbid}/front-500.jpg' - GROUP_URL = 'http://coverartarchive.org/release-group/{mbid}/front-500.jpg' + URL = 'http://coverartarchive.org/release/{mbid}/front' + GROUP_URL = 'http://coverartarchive.org/release-group/{mbid}/front' def get(self, album): """Return the Cover Art Archive and Cover Art Archive release group URLs diff --git a/docs/changelog.rst b/docs/changelog.rst index 763cb16eb..3795fb265 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,8 @@ Changelog goes here! * :doc:`/plugins/fetchart`: new settings `minwidth` and `enforce_ratio` to put restrictions (min width in pixels, and 1:1 image ratio, resp.) for valid album art candidates. :bug:`1394` +* :dox:`/plugins/fetchart`: Remove hard size limit when fetching from the + CoverArtArchive. 1.3.11 (April 5, 2015) ---------------------- diff --git a/test/test_art.py b/test/test_art.py index ab403ec5d..c7476f52f 100644 --- a/test/test_art.py +++ b/test/test_art.py @@ -109,7 +109,7 @@ class CombinedTest(UseThePlugin): .format(ASIN) AAO_URL = 'http://www.albumart.org/index_detail.php?asin={0}' \ .format(ASIN) - CAA_URL = 'http://coverartarchive.org/release/{0}/front-500.jpg' \ + CAA_URL = 'http://coverartarchive.org/release/{0}/front' \ .format(MBID) def setUp(self):