From 0f1add8b027e009d5d1bde90fb25e4fbff80247c Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Fri, 26 May 2023 08:31:51 -0400 Subject: [PATCH 1/3] Change to spotify_album_id --- beetsplug/fetchart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 3ace8f0dd..a29ab6a41 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -956,7 +956,7 @@ class Spotify(RemoteArtSource): return HAS_BEAUTIFUL_SOUP def get(self, album, plugin, paths): - url = self.SPOTIFY_ALBUM_URL + album.mb_albumid + url = self.SPOTIFY_ALBUM_URL + album.items().get().spotify_album_id try: response = requests.get(url) response.raise_for_status() From 7a9d8f9752568035eecf29214a19af199e9a3772 Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Fri, 26 May 2023 08:40:15 -0400 Subject: [PATCH 2/3] added error handling --- beetsplug/fetchart.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index a29ab6a41..b508a5f66 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -956,7 +956,11 @@ class Spotify(RemoteArtSource): return HAS_BEAUTIFUL_SOUP def get(self, album, plugin, paths): - url = self.SPOTIFY_ALBUM_URL + album.items().get().spotify_album_id + try: + url = self.SPOTIFY_ALBUM_URL + album.items().get().spotify_album_id + except AttributeError: + self._log.debug('Fetchart: no Spotify album ID found') + return try: response = requests.get(url) response.raise_for_status() From c0bae4e5c016a830421eb77fdc71a39c93c4f74d Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Fri, 26 May 2023 08:48:25 -0400 Subject: [PATCH 3/3] Update changelog.rst --- docs/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 02c4f1762..05b450019 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,8 @@ for Python 3.6). New features: +* Fetchart: Use the right field (`spotify_album_id`) to obtain the Spotify album id + :bug:`4803` * Prevent reimporting album if it is permanently removed from Spotify :bug:`4800` * Added option use `cover_art_arl` as an album art source in the `fetchart` plugin.