From a08b54c8b35698025e2390a24306eeeb116a1c8f Mon Sep 17 00:00:00 2001 From: logykk Date: Sun, 24 Oct 2021 22:04:53 +1300 Subject: [PATCH] revert metadata patch --- src/album.py | 2 +- src/track.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/album.py b/src/album.py index d797d023..12f86eb6 100644 --- a/src/album.py +++ b/src/album.py @@ -28,7 +28,7 @@ def get_album_tracks(album_id): def get_album_name(album_id): """ Returns album name """ resp = ZSpotify.invoke_url(f'{ALBUM_URL}/{album_id}') - return sanitize_data(resp[ARTISTS][0][NAME]), sanitize_data(resp[NAME]) + return resp[ARTISTS][0][NAME], sanitize_data(resp[NAME]) def get_artist_albums(artist_id): diff --git a/src/track.py b/src/track.py index dc148b0d..d2ed1b10 100644 --- a/src/track.py +++ b/src/track.py @@ -37,9 +37,9 @@ def get_song_info(song_id) -> tuple[list[str], str, str, Any, Any, Any, Any, Any artists = [] for data in info[TRACKS][0][ARTISTS]: - artists.append(data[NAME]) - album_name = info[TRACKS][0][ALBUM][NAME] - name = info[TRACKS][0][NAME] + artists.append(sanitize_data(data[NAME])) + album_name = sanitize_data(info[TRACKS][0][ALBUM][NAME]) + name = sanitize_data(info[TRACKS][0][NAME]) image_url = info[TRACKS][0][ALBUM][IMAGES][0][URL] release_year = info[TRACKS][0][ALBUM][RELEASE_DATE].split('-')[0] disc_number = info[TRACKS][0][DISC_NUMBER] @@ -57,7 +57,7 @@ def download_track(track_id: str, extra_paths='', prefix=False, prefix_value='', (artists, album_name, name, image_url, release_year, disc_number, track_number, scraped_song_id, is_playable) = get_song_info(track_id) - song_name = sanitize_data(artists[0]) + ' - ' + sanitize_data(name) + song_name = artists[0] + ' - ' + name if prefix: song_name = f'{prefix_value.zfill(2)} - {song_name}' if prefix_value.isdigit( ) else f'{prefix_value} - {song_name}'