From f2c624f86e530b446a09d9f4386bd5537f4ad7d0 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 24 Dec 2018 21:35:03 +0100 Subject: [PATCH] actually this is a better fix --- discordbot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/discordbot.py b/discordbot.py index 7817625f..4e3c7ae8 100644 --- a/discordbot.py +++ b/discordbot.py @@ -333,7 +333,7 @@ class VideoQueue: def not_ready_videos(self, limit: typing.Optional[int] = None): """Return the non-ready videos in the first limit positions of the queue.""" video_list = [] - for video in self.list[:limit]: + for video in (self.list[:limit] + [self.now_playing]): if not video.is_ready: video_list.append(video) return video_list @@ -672,8 +672,7 @@ class RoyalDiscordBot(discord.Client): while True: await asyncio.sleep(1) # Might have some problems with del - for index, video in enumerate(self.video_queue.not_ready_videos(self.max_videos_to_predownload) + - [self.video_queue.now_playing]): + for index, video in enumerate(self.video_queue.not_ready_videos(self.max_videos_to_predownload)): try: with async_timeout.timeout(self.max_video_ready_time): await loop.run_in_executor(executor, video.ready_up)