From e4a4401de6e9254ba8a69ea30645be42fb1f1638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Forment?= Date: Sun, 16 Jun 2024 22:05:43 +0200 Subject: [PATCH] Fix bug with newly introduced function in superdirt.py --- sardine_core/handlers/superdirt.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sardine_core/handlers/superdirt.py b/sardine_core/handlers/superdirt.py index 3ad97f35..0b344f9b 100644 --- a/sardine_core/handlers/superdirt.py +++ b/sardine_core/handlers/superdirt.py @@ -113,12 +113,14 @@ def _dirt_panic(self): self._dirt_play(message=["sound", "superpanic"]) def _handle_sample_number(self, message: dict): - if ":" in message["sound"]: - orig_sp, orig_nb = message["sound"].split(":") - message["sound"] = orig_sp + ":" + str(int(orig_nb) + int(message["n"])) + sound = str(message["sound"]) + if ":" in sound: + orig_sp, orig_nb = sound.split(":") + sound = orig_sp + ":" + str(int(orig_nb) + int(message["n"])) else: - message["sound"] = message["sound"] + ":" + str(message["n"]) + sound = sound + ":" + str(message["n"]) del message["n"] + message["sound"] = sound return message def _parse_aliases(self, pattern: dict):