From 6f7e69411b0caeec1d7d56cd315ce5075d0c2b24 Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Wed, 25 Sep 2024 21:09:10 -0400 Subject: [PATCH] Update code to remove a trialing _ from the artist name. --- api_calls.py | 1 + get_artist_art.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api_calls.py b/api_calls.py index f86f03a..fbe7e09 100644 --- a/api_calls.py +++ b/api_calls.py @@ -2,6 +2,7 @@ import requests import os def get_mb_id(artist_name, mb_confidence): + artist_name = artist_name.strip('_') mb_url = f'https://musicbrainz.org/ws/2/artist?query=artist:%22{artist_name}%22&fmt=json' response = requests.get(mb_url) if response.status_code == 200: diff --git a/get_artist_art.py b/get_artist_art.py index 6efde5b..0a3f03b 100755 --- a/get_artist_art.py +++ b/get_artist_art.py @@ -19,7 +19,7 @@ for artist in dir_list: artist_path = os.path.join(music_path, artist) if (not(dir_activities.has_artist_art(artist_path))): print(dir_activities.has_artist_art(artist_path)) - print(str(count) + ": " + artist) + print(str(count) + ": " + artist.strip('_')) try: found_status, mb_id = api_calls.get_mb_id(artist, mb_confidence) # print("Getting ", artist_image)