diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-13 13:06:46 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-13 13:06:46 +0100 |
| commit | ab2ebfd768bcc11f9c9124c15d9da700b9352587 (patch) | |
| tree | 82f1bdd0a1b3d80db375a193edaa2fa7e3615855 /deckit | |
| parent | 16fe39a322087ba829ce482284e3fdad86df66a0 (diff) | |
| download | deck-it-ab2ebfd768bcc11f9c9124c15d9da700b9352587.tar.gz deck-it-ab2ebfd768bcc11f9c9124c15d9da700b9352587.zip | |
fix(music): accept a fractional track length
Haruna reports mpris:length as a float (65816666.666666664), so int()
raised and the whole state failed: the widget said nothing was playing
while a video played. Parse length and position as floats.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deckit')
| -rw-r--r-- | deckit/modules/music.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/deckit/modules/music.py b/deckit/modules/music.py index ef19cd0..f590cc0 100644 --- a/deckit/modules/music.py +++ b/deckit/modules/music.py @@ -62,7 +62,7 @@ def make(cfg: dict) -> Module: else: art_src = None return {"status": status, "title": title, "artist": artist, "album": album, - "length": int(length or 0) / 1e6, "position": int(pos or 0) / 1e6, + "length": float(length or 0) / 1e6, "position": float(pos or 0) / 1e6, "art": art_src, "player": name.split(".")[0], "volume": volume} def seek(body): |
