diff options
author | Alok Saboo <arsaboo@gmx.com> | 2023-11-12 09:43:59 -0500 |
---|---|---|
committer | Alok Saboo <arsaboo@gmx.com> | 2023-11-12 09:43:59 -0500 |
commit | 9e1c530c9d6457b9fa2542411273480e39926f84 (patch) | |
tree | a203d239b6837eca42b5140dd11c746bda209da1 | |
parent | e7d86f2fc93c97ede66fd35642db8c01f649e2c1 (diff) |
also include EAN and UPC
-rw-r--r-- | beetsplug/spotify.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 85c39f5df..ad29bb3ad 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -661,6 +661,8 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): info = self.track_info(spotify_track_id) item["spotify_track_popularity"] = info[0] item["isrc"] = info[1] + item["ean"] = info[2] + item["upc"] = info[3] audio_features = self.track_audio_features(spotify_track_id) if audio_features is None: self._log.info("No audio features found for: {}", item) @@ -676,7 +678,7 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): item.try_write() def track_info(self, track_id=None): - """Fetch a track popularity and ISRC by its Spotify ID.""" + """Fetch a track popularity and other external_ids by its Spotify ID.""" track_data = self._handle_response( requests.get, self.track_url + track_id ) @@ -684,7 +686,9 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): track_data.get("popularity"), track_data.get("external_ids").get("isrc")) return [track_data.get("popularity"), - track_data.get("external_ids").get("isrc")] + track_data.get("external_ids").get("isrc"), + track_data.get("external_ids").get("ean"), + track_data.get("external_ids").get("upc")] def track_audio_features(self, track_id=None): """Fetch track audio features by its Spotify ID.""" |