當前位置: 首頁>>代碼示例>>Python>>正文


Python MusicBrainzClient.add_edit_note方法代碼示例

本文整理匯總了Python中editing.MusicBrainzClient.add_edit_note方法的典型用法代碼示例。如果您正苦於以下問題:Python MusicBrainzClient.add_edit_note方法的具體用法?Python MusicBrainzClient.add_edit_note怎麽用?Python MusicBrainzClient.add_edit_note使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在editing.MusicBrainzClient的用法示例。


在下文中一共展示了MusicBrainzClient.add_edit_note方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: out

# 需要導入模塊: from editing import MusicBrainzClient [as 別名]
# 或者: from editing.MusicBrainzClient import add_edit_note [as 別名]
                for r, gid, barcode in db.execute(query_releases, identifier):
                    if identifier != barcode.lstrip('0'):
                        out('barcode does not match, aborting!')
                        continue
                    out('https://musicbrainz.org/release/%s' % gid)
                    mb_release = ws.get_release(gid)
                    mb_tracks = mb_release.getTracks()
                    if len(mb_tracks) != len(tracks):
                        out('track count does not match (%d != %d), aborting!' % (len(mb_tracks), len(tracks)))
                        continue
                    found = True
                    isrcs = [zeroinch.get_track(artist, t) for t in tracks]
                    out(isrcs)
                    tracks2isrcs = {}
                    for mb_track, isrc in zip(mb_tracks, isrcs):
                        if isrc and len(isrc) == 12 and isrc not in mb_track.getISRCs():
                            tracks2isrcs[mb_track.getId()] = isrc
                    out(tracks2isrcs.values())
                    if tracks2isrcs:
                        ws.submit_isrcs(tracks2isrcs)
                        text = u'From %s, added because of matching barcode %s.' % (url, barcode)
                        mb.add_edit_note(identify_isrc_edit(tracks2isrcs.values()), text)
                if found:
                    db.execute("INSERT INTO bot_isrc_zeroinch_submitted (url) VALUES (%s)", url)
                    isrc_submitted.add(url)
                else:
                    db.execute("INSERT INTO bot_isrc_zeroinch_missing (url) VALUES (%s)", url)
                    isrc_missing.add(url)
        db.execute("INSERT INTO bot_isrc_zeroinch_submitted (url) VALUES (%s)", artist_url)
        isrc_submitted.add(artist_url)
開發者ID:Freso,項目名稱:musicbrainz-bot,代碼行數:32,代碼來源:isrc_zeroinch.py


注:本文中的editing.MusicBrainzClient.add_edit_note方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。