def search(self, artist, album, track):
'''get musicbrainz id by query of artist, album and/or track'''
albumid = ""
artistid = ""
try:
# lookup with artist and album (preferred method)
if artist and album:
artistid, albumid = self.search_release_group_match(artist, album)
# lookup with artist and track (if no album provided)
if not (artistid and albumid) and artist and track:
artistid, albumid = self.search_recording_match(artist, track)
# last resort: lookup with trackname as album
if not (artistid and albumid) and artist and track:
artistid, albumid = self.search_release_group_match(artist, track)
except Exception as exc:
log_msg("Error in musicbrainz.search: %s" % str(exc), xbmc.LOGWARNING)
return (artistid, albumid)
mbrainz.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录