Skip to content

fix: handle livestream sentinel length in lyrics and media player for twitch as media source - #1648

Merged
soramanew merged 3 commits into
caelestia-dots:mainfrom
linusgenz:fix-media-player-with-twitch
Jul 16, 2026
Merged

fix: handle livestream sentinel length in lyrics and media player for twitch as media source#1648
soramanew merged 3 commits into
caelestia-dots:mainfrom
linusgenz:fix-media-player-with-twitch

Conversation

@linusgenz

Copy link
Copy Markdown
Contributor

fixes #1645

Fixes the crash when opening the dashboard media section while a Twitch livestream is playing.

Cause

Twitch reports INT64_MAX as the MPRIS Length for livestreams. After Quickshell's µs→s conversion this becomes ~9.22e12 exceeding INT_MAX. When the lyrics service passed this value to qRound(double), Qt's checked FP-to-integer conversion asserted and aborted.
YouTube Live is unaffected because it reports the DVR buffer length as the track length, which is a normal-sized value.

Changes

lyrics.cpp
guard qRound(m_duration) against values that don't fit in int. The duration parameter is omitted from the lrclib query for livestreams; lrclib handles this gracefully by falling back to title/artist matching.
Details.qml
added isLive (threshold: length > INT_MAX) to show LIVE instead of 577014:32:22 on the right label, and disable the seek slider to prevent the stream from freezing on interaction since seeking is not supported on twitch.

lmk if this is fine the way it is, or if we should handle this different. We can't really copy the behavior from youtube streams, since twitch reports different data

@soramanew
soramanew merged commit dbb6d6c into caelestia-dots:main Jul 16, 2026
3 checks passed
DaveLewis360 added a commit to DaveLewis360/shell that referenced this pull request Jul 30, 2026
* upstream/main:
  fix: use GNUInstallDirs for install dirs (caelestia-dots#1762)
  fix: fp precision for nexus
  fix: nominatim compliance (caelestia-dots#1752)
  [CI] chore: update flake
  fix: repeated low battery warnings (caelestia-dots#1477)
  refactor: change IP-lookup API + handle retry on rate limited (caelestia-dots#1734)
  fix: eager load certain services (caelestia-dots#1733)
  feat: add utilities panel confs to nexus (caelestia-dots#1725)
  [CI] chore: update flake
  fix: file system model sorting
  fix: fully round toggled network filter chips
  feat: add saved networks sub page to nexus (caelestia-dots#1722)
  feat: cap networks shown in nexus (caelestia-dots#1719)
  fix: nexus network null warnings
  fix: battery time calc
  feat: nexus VPN section with provider management (caelestia-dots#1605)
  fix: add qtimageformats to nix qs dep (caelestia-dots#1716)
  ci: add nix build workflow (caelestia-dots#1715)
  fix: handle > INT_MAX player lengths overflowing in lyrics (caelestia-dots#1648)
  feat: hidden networks, per-network settings and IPv4 config (caelestia-dots#1604)
  fix: key ZFS filesystems by pool in storage service (caelestia-dots#1673)
  fix: support delayed "xesam:artist" for now playing toast (caelestia-dots#1700)
  fix: preserve unknown config keys on save (caelestia-dots#1675)
  fix: populate pipewire nodes immediately (caelestia-dots#1699)
  fix: launcher action searching (caelestia-dots#1695)
  chore: fix lint warnings (caelestia-dots#1705)
  [CI] chore: update flake
  [CI] chore: update flake
  fix: improve compact tray styling
  refactor: use Item instead of Loader for bar entries (caelestia-dots#1663)
  refactor: improve state handling & add component hooks (caelestia-dots#1661)
  fix: ethernet devices incorrect end rounding
  fix: text field outline outside of widget bounds
  feat: add lock howdy support (caelestia-dots#1515)
  fix: don't animate calendar today indicator
  chore: remove unused Tooltip component
  fix: menu/popup overlays overriding cursor shape
  feat: improve text controls (caelestia-dots#1647)

# Conflicts:
#	modules/bar/Bar.qml
#	modules/bar/BarWrapper.qml
#	modules/bar/components/Tray.qml
#	modules/drawers/ContentWindow.qml
#	modules/drawers/Interactions.qml
#	modules/drawers/Panels.qml
#	modules/lock/NotifGroup.qml
#	services/Players.qml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRASH] Quickshell crashes, when twitch is the media source in the dashboard

2 participants