|
@@ -90,16 +90,18 @@ def lookup_artist_from_mb(artist_name: str) -> str:
|
|
|
return top_result
|
|
|
|
|
|
|
|
|
-def lookup_track_from_mb(artist_name: str) -> str:
|
|
|
+def lookup_track_from_mb(
|
|
|
+ track_name: str, artist_mbid: str, album_mbid: str
|
|
|
+) -> str:
|
|
|
musicbrainzngs.set_useragent('vrobbler', '0.3.0')
|
|
|
|
|
|
- top_result = musicbrainzngs.search_recordings(artist=artist_name)[
|
|
|
- 'artist-list'
|
|
|
- ][0]
|
|
|
+ top_result = musicbrainzngs.search_recordings(
|
|
|
+ query=track_name, artist=artist_mbid, release=album_mbid
|
|
|
+ )['recording-list'][0]
|
|
|
score = int(top_result.get('ext:score'))
|
|
|
if score < 85:
|
|
|
logger.debug(
|
|
|
- "Artist lookup score below 85 threshold",
|
|
|
+ "Track lookup score below 85 threshold",
|
|
|
extra={"result": top_result},
|
|
|
)
|
|
|
return ""
|