diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 026b9da1c..0ada97e8b 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -219,6 +219,9 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): album_data = self._handle_response( requests.get, self.album_url + spotify_id ) + 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 = [ 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`.