From 17a35c43e30e00d0385732764afe546ff1eeb146 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Sat, 13 Mar 2021 02:39:46 -0300 Subject: [PATCH 1/2] Avoid auto pausing when playlist is empty --- mumbleBot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mumbleBot.py b/mumbleBot.py index e6f5e57..ec86631 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -356,8 +356,8 @@ class MumbleBot: elif var.config.get("bot", "when_nobody_in_channel") == "pause": self.send_channel_msg(tr("auto_paused")) - elif len(own_channel.get_users()) == 1: - # if the bot is the only user left in the channel + elif len(own_channel.get_users()) == 1 and len(var.playlist) != 0: + # if the bot is the only user left in the channel and the playlist isn't empty self.log.info('bot: Other users in the channel left. Stopping music now.') if var.config.get("bot", "when_nobody_in_channel") == "stop": From 736fac28b0178c56db3fd20770c3446c4b3f0d3b Mon Sep 17 00:00:00 2001 From: SeerLite Date: Sat, 13 Mar 2021 02:40:08 -0300 Subject: [PATCH 2/2] Don't send auto_pause hint message if not paused --- mumbleBot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mumbleBot.py b/mumbleBot.py index ec86631..5ab48de 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -353,7 +353,7 @@ class MumbleBot: if len(own_channel.get_users()) == 2: if var.config.get("bot", "when_nobody_in_channel") == "pause_resume": self.resume() - elif var.config.get("bot", "when_nobody_in_channel") == "pause": + elif var.config.get("bot", "when_nobody_in_channel") == "pause" and self.is_pause: self.send_channel_msg(tr("auto_paused")) elif len(own_channel.get_users()) == 1 and len(var.playlist) != 0: