From db2fda70bde70cc10c73d57d0f99d5646d8639ed Mon Sep 17 00:00:00 2001 From: ltadeu6 Date: Wed, 10 Jun 2026 15:00:46 -0300 Subject: [PATCH] refactor: remove skeleton toggle/shortcut feature from control server show_skeleton is now managed by the Plasma wallpaper config directly, so the server no longer needs toggle-skeleton, set-shortcut endpoints, pynput hotkey listener, or the show_skeleton field in /current. Also fixes unclosed file handle in the /art handler. Co-Authored-By: Claude Sonnet 4.6 --- luz-musica.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/luz-musica.py b/luz-musica.py index d884c3b..b566b6d 100644 --- a/luz-musica.py +++ b/luz-musica.py @@ -109,12 +109,12 @@ class ControlState: verse_lines, verse_active = find_active_verse(verses, position) line = verse_lines[verse_active] if verse_active >= 0 and verse_lines else "" return { - "art_url": getattr(self, "_art_url", None), - "rgb": list(getattr(self, "_rgb", [0, 200, 255])), - "rgb2": list(getattr(self, "_rgb2", [255, 0, 150])), - "lyric_line": line, - "verse_lines": verse_lines, - "verse_active": verse_active, + "art_url": getattr(self, "_art_url", None), + "rgb": list(getattr(self, "_rgb", [0, 200, 255])), + "rgb2": list(getattr(self, "_rgb2", [255, 0, 150])), + "lyric_line": line, + "verse_lines": verse_lines, + "verse_active": verse_active, } @@ -139,7 +139,8 @@ class ControlHandler(BaseHTTPRequestHandler): return try: if art_url.startswith("file://"): - body = open(art_url[7:], "rb").read() + with open(art_url[7:], "rb") as f: + body = f.read() ctype = "image/png" if art_url.endswith(".png") else "image/jpeg" else: resp = requests.get(art_url, timeout=5)