当前位置: 首页>>代码示例>>Python>>正文


Python Track.get_tag_raw方法代码示例

本文整理汇总了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
开发者ID:arshavindn,项目名称:Miusik,代码行数:27,代码来源:playlist.py

示例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)
开发者ID:arshavindn,项目名称:Miusik,代码行数:19,代码来源:playlist.py


注:本文中的track.Track.get_tag_raw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。