mb_confidence now working as a variable.
The value from config.ini is returned as a string. It needs to be cast to an int before use.
This commit is contained in:
@@ -8,13 +8,15 @@ def get_mb_id(artist_name, mb_confidence):
|
||||
mb_data = response.json()
|
||||
if mb_data['count'] > 0:
|
||||
if mb_data['artists'][0]['score'] > mb_confidence:
|
||||
return mb_data['artists'][0]['id']
|
||||
return True, mb_data['artists'][0]['id']
|
||||
else:
|
||||
print("No artist found of hight enough confidance.")
|
||||
else:
|
||||
print("No artist found.")
|
||||
return False, ""
|
||||
else:
|
||||
print(f"Error: {response.status_code}")
|
||||
return False, ""
|
||||
|
||||
def get_image(mb_id, ftv_api_key, artist_path):
|
||||
ftv_api_url = f'https://webservice.fanart.tv/v3/music/{mb_id}?api_key={ftv_api_key}'
|
||||
|
||||
Reference in New Issue
Block a user