From c0e3a530f755fe8e4396830496fd2409293556a1 Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Thu, 25 May 2023 13:41:09 -0400 Subject: [PATCH 1/3] Update spotify.py --- beetsplug/spotify.py | 1 + 1 file changed, 1 insertion(+) diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 026b9da1c..c14e348ba 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -219,6 +219,7 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): album_data = self._handle_response( requests.get, self.album_url + spotify_id ) + self._log.debug('Album data: {}', album_data) artist, artist_id = self.get_artist(album_data['artists']) date_parts = [ From fa822d6ab2c9ea6ac1032ecd8104061e77ca70fc Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Thu, 25 May 2023 13:55:57 -0400 Subject: [PATCH 2/3] Add a check for valid data --- beetsplug/spotify.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index c14e348ba..0ada97e8b 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -219,7 +219,9 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): album_data = self._handle_response( requests.get, self.album_url + spotify_id ) - self._log.debug('Album data: {}', album_data) + if album_data['name'] == "": + self._log.debug("Album removed from Spotify: {}", album_id) + return None artist, artist_id = self.get_artist(album_data['artists']) date_parts = [ From 1ed41d3bceca3be2ef24c3df08f850ea3c801742 Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Thu, 25 May 2023 13:59:32 -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 8ca8d711a..02c4f1762 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,8 @@ for Python 3.6). New features: +* 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. :bug:`4707` * :doc:`/plugins/fetchart`: The plugin can now get album art from `spotify`.