本文整理汇总了Python中mutagen.File.tags['artist']方法的典型用法代码示例。如果您正苦于以下问题:Python File.tags['artist']方法的具体用法?Python File.tags['artist']怎么用?Python File.tags['artist']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mutagen.File
的用法示例。
在下文中一共展示了File.tags['artist']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_basic_tags
# 需要导入模块: from mutagen import File [as 别名]
# 或者: from mutagen.File import tags['artist'] [as 别名]
def write_basic_tags(self, modify_tags, set_artist_to_album, set_version):
audio = File(self.filename, easy=True)
if audio.tags is None:
audio.add_tags()
if modify_tags:
if self.album is not None:
audio.tags['album'] = self.album
if self.title is not None:
audio.tags['title'] = self.title
if self.genre is not None:
audio.tags['genre'] = self.genre
if self.pubDate is not None:
audio.tags['date'] = self.pubDate
if set_artist_to_album:
audio.tags['artist'] = self.album
if type(audio) is EasyMP3:
audio.save(v2_version=set_version)
else:
# Not actually audio
audio.save()
示例2: write_basic_tags
# 需要导入模块: from mutagen import File [as 别名]
# 或者: from mutagen.File import tags['artist'] [as 别名]
def write_basic_tags(self, set_artist_to_album):
audio = File(self.filename, easy=True)
if audio.tags is None:
audio.add_tags()
if self.album is not None:
audio.tags['album'] = self.album
if self.title is not None:
audio.tags['title'] = self.title
if self.genre is not None:
audio.tags['genre'] = self.genre
if self.pubDate is not None:
audio.tags['date'] = self.pubDate
if set_artist_to_album:
audio.tags['artist'] = self.album
audio.save()