Add mb_confidence as a configurable variable.

Update the project main and api_calls.py to get and use a confidence value set in config.ini.
This commit is contained in:
2024-09-20 13:03:57 -04:00
parent d6060c2e61
commit 370151373c
2 changed files with 4 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ config.read('config.ini')
music_path = config['music']['dir']
ftv_api_key = config['fanart_tv']['api_key']
mb_confidence = config['musicbrainz']['confidence']
count = 1
dir_list = dir_activities.get_all(music_path)
@@ -19,7 +20,7 @@ for artist in dir_list:
print(dir_activities.has_artist_art(artist))
print(str(count) + ": " + artist)
try:
mb_id = api_calls.get_mb_id(artist)
mb_id = api_calls.get_mb_id(artist, mb_confidence)
# print("Getting ", artist_image)
artist_image = api_calls.get_image(mb_id, ftv_api_key, os.path.join(music_path, artist))