mbrainz.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:script.module.metadatautils 作者: marcelveldt 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号