Make progress bar cursor draggable
Deploy HEOS panel / deploy (push) Successful in 26s

This commit is contained in:
2026-09-16 23:19:08 +02:00
parent 51dff45b54
commit ec684b7803
12 changed files with 319 additions and 29 deletions
+10
View File
@@ -90,7 +90,12 @@ class SpotifyClient:
try:
with urllib.request.urlopen(request, timeout=self.timeout) as response:
raw = response.read()
# A player command (seek, say) can answer 200 with a body that is
# not JSON at all -- it worked, there is just nothing to read.
try:
return json.loads(raw) if raw else {}
except ValueError:
return {}
except urllib.error.HTTPError as exc:
if exc.code == 401 and not retrying:
# The access token can go stale between calls even inside
@@ -135,6 +140,11 @@ class SpotifyClient:
self._call("PUT", "/v1/me/player", body={"device_ids": [device["id"]], "play": True})
return device
def seek(self, position_ms: int):
"""Jump to position_ms in whatever the account is playing, on
whichever device is playing it."""
self._call("PUT", f"/v1/me/player/seek?position_ms={int(position_ms)}")
def _error_detail(exc: urllib.error.HTTPError) -> str:
try: