本文整理汇总了Python中track.Track.get_tag_raw方法的典型用法代码示例。如果您正苦于以下问题:Python Track.get_tag_raw方法的具体用法?Python Track.get_tag_raw怎么用?Python Track.get_tag_raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.get_tag_raw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_track
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import get_tag_raw [as 别名]
def add_track(self, loc, trackdb):
track = trackdb.get_track_by_loc(loc)
if not track:
track = Track(loc)
respone = trackdb.add_track_from_trackobj(track)
if not respone:
return False
tr_album = track.get_tag_raw('album', True)
tr_albumartist = track.get_tag_raw('albumartist', True)
if tr_albumartist == u'':
tr_albumartist = track.get_tag_raw('artist', True)
album = self.get_album_from_info(tr_album, tr_albumartist)
if not album:
# create new album
album = Album(tr_album, tr_albumartist)
self.__albums[(tr_album, tr_albumartist)] = album
album.unchecked_add_song(track)
self.__total_duration += track.get_tag_raw('__length')
# cover = coverdb.get_cover(tr_album, tr_albumartist)
# if not cover:
# tr_cover = track.get_tag_disk('cover')
# if tr_cover:
# coverdb.add_cover(tr_album, tr_albumartist, tr_cover)
return track
示例2: remove_track
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import get_tag_raw [as 别名]
def remove_track(self, loc, trackdb):
"""
Remove song from playlist with given location.
"""
track = trackdb.get_track_by_loc(loc)
if not track:
track = Track(loc)
if not track._scan_valid:
return False
tr_album = track.get_tag_raw('album', True)
tr_albumartist = track.get_tag_raw('albumartist', True)
if tr_albumartist == u'':
tr_albumartist = track.get_tag_raw('artist', True)
album = self.get_album_from_info(tr_album, tr_albumartist)
if not album:
return False
return album.remove_track(loc)