本文整理汇总了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)