From 2b5e6d7c036c7eed79004c1b166ff1bffd967af4 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sun, 14 Dec 2025 11:18:53 +0100 Subject: [PATCH] well --- modules/active_modifier.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/active_modifier.py b/modules/active_modifier.py index 1178fd6..377bf30 100644 --- a/modules/active_modifier.py +++ b/modules/active_modifier.py @@ -129,7 +129,11 @@ class Module(ActiveModifier): elif data.get("action") == "clear_toplay": with self.file_lock: # Due to policy, i will not recommend to strip the next song but only the songs after. - with open(TOPLAY, "r") as f: first_line = f.readline() + with open(TOPLAY, "r") as f: + first_line, i = "", 0 + while not first_line.strip() and i < 3: + first_line = f.readline() + i += 1 with open(TOPLAY, "w") as f: f.write(first_line.strip() + "\n") return {"status": "ok", "data": [first_line.strip()]}