0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 13:52:00 +01:00
This commit is contained in:
2025-12-14 11:18:53 +01:00
parent 9c61fcfa38
commit 2b5e6d7c03

View File

@@ -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()]}