From 79982fa81a0fad5890dee4a381dcbc47bad31161 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 12 Apr 2019 19:24:42 +0200 Subject: [PATCH] If the Pool is empty, don't add a song --- royalnet/audio/playmodes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/royalnet/audio/playmodes.py b/royalnet/audio/playmodes.py index 70c61d85..d9f4e904 100644 --- a/royalnet/audio/playmodes.py +++ b/royalnet/audio/playmodes.py @@ -51,6 +51,9 @@ class Pool(PlayMode): async def next(self): while True: + if self.pool: + yield None + continue self._pool_copy = self.pool.copy() random.shuffle(self._pool_copy) while self._pool_copy: