def checkUpdate(): from queue import queue from State import state import threading curThread = threading.currentThread() checkAgain = True while checkAgain: checkAgain = False # This is cheap / almost free if the peek-list didn't change. state.player.reloadPeekStreams() songs = [] if state.curSong: songs += [state.curSong] songs += queue.peekNextN(PreloadNextN) for song in songs: if song is None: continue if curThread.cancel: return if needUpdate(song): update(song) checkAgain = True break
def checkUpdate(): from queue import queue from State import state import threading curThread = threading.currentThread() checkAgain = True while checkAgain: checkAgain = False songs = [] if state.curSong: songs += [state.curSong] songs += queue.peekNextN(PreloadNextN) for song in songs: if song is None: continue if curThread.cancel: return if needUpdate(song): update(song) checkAgain = True break