diff --git a/utils/miniplayer.py b/utils/miniplayer.py index d37f94f..7aaa76c 100755 --- a/utils/miniplayer.py +++ b/utils/miniplayer.py @@ -83,13 +83,19 @@ class MiniPlayer(object): if len(self.__playNext) > 0 and os.path.isfile(self.__playNext[0]): anim = self.__playNext.pop(0) else: - anims = { os.path.join(dp, fn) for dp, dns, fns in \ - os.walk(self.__animDir, followlinks=True) for fn in fns } + anims = set() + for dp, dns, fns in os.walk(self.__animDir, followlinks=True): + if os.path.basename(dp).startswith('.'): + continue + for fn in filter(lambda f: not f.startswith('.'), fns): + anims.add(os.path.join(dp, fn)) + if anims != self.__anims or len(self.__anims_remaining) == 0: self.__anims = anims self.__anims_remaining = set(anims) anim = random.sample(self.__anims_remaining, 1)[0] self.__anims_remaining.remove(anim) + return anim def run(self): @@ -105,8 +111,7 @@ class MiniPlayer(object): while self.__running: # begin to load the next animation - filename = os.path.join(self.__animDir, self.getNextFilename()) - loader = AnimationLoaderThread(filename) + loader = AnimationLoaderThread(self.getNextFilename()) loader.start() # play the animation in case it had been successfully loaded before