def get_curplayback(self):
'''get current playback details - retry on error'''
count = 5
while count and self.active:
try:
cur_playback = self.dialog.sp.current_playback()
return cur_playback
except Exception as exc:
if "token expired" in str(exc):
token = xbmc.getInfoLabel("Window(Home).Property(spotify-token)")
self.sp._auth = token
else:
log_exception(__name__, exc)
count -= 1
xbmc.sleep(500)
self.dialog.close_dialog()
return None
评论列表
文章目录