本文整理匯總了Python中editing.MusicBrainzClient.add_cover_art方法的典型用法代碼示例。如果您正苦於以下問題:Python MusicBrainzClient.add_cover_art方法的具體用法?Python MusicBrainzClient.add_cover_art怎麽用?Python MusicBrainzClient.add_cover_art使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類editing.MusicBrainzClient
的用法示例。
在下文中一共展示了MusicBrainzClient.add_cover_art方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: colored_out
# 需要導入模塊: from editing import MusicBrainzClient [as 別名]
# 或者: from editing.MusicBrainzClient import add_cover_art [as 別名]
images = self.metadata['images']
else:
images = []
for image in self.metadata['images']:
for img_type in image['types']:
if img_type == type:
images.append(image)
break
return images
for file in sys.argv[1:]:
colored_out(bcolors.OKBLUE, "File '%s'" % os.path.basename(file))
if not os.path.exists(file):
colored_out(bcolors.FAIL, " * File not found")
continue
m = FILE_RE.match(os.path.basename(file))
if m is None:
colored_out(bcolors.FAIL, " * File doesn't match defined regular expression")
continue
mbid = m.group('mbid')
type = m.group('type')
caa_rel_info = CoverArtArchiveReleaseInfo(mbid)
if caa_rel_info.hasType(type) and type not in ('medium', 'booklet') and False:
colored_out(bcolors.WARNING, " * Release already has an image of type '%s' => skipping" % type.lower())
continue
colored_out(bcolors.OKGREEN, " * Adding %s cover art to http://musicbrainz.org/release/%s" % (type, mbid))
time.sleep(10)
mb.add_cover_art(mbid, file, [type], None, '', '', False)