scrobbler.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:service.scrobbler.hatchet 作者: michiwend 项目源码 文件源码
def onPlayBackStarted( self ):
        # only do something if we're playing audio
        if self.isPlayingAudio():
            # we need to keep track of this bool for stopped/ended notifications
            self.Audio = True
            # keep track of onPlayBackStarted events http://trac.xbmc.org/ticket/13064
            self.Count += 1
            log('#DEBUG# onPlayBackStarted: %i' % self.Count)
            # tags are not available instantly and we don't what to announce right away as the user might be skipping through the songs
            xbmc.sleep(2000)
            # don't announce if user already skipped to the next track
            if self.Count == 1:
                # reset counter
                self.Count = 0
                # get tags
                tags = self._get_tags()
                # announce song
                self.action(tags, self.service)
            else:
                # multiple onPlayBackStarted events occurred, only act on the last one
                log('#DEBUG# skipping onPlayBackStarted event')
                self.Count -= 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号