mirror of
https://github.com/Rigellute/spotify-tui.git
synced 2026-04-27 00:25:53 +03:00
[GH-ISSUE #125] Panic when switching to short track from long current progress in longer track #71
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-tui#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sputnick1124 on GitHub (Nov 1, 2019).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/125
Reproduce
After playback on a long track has attained
xseconds, switch to track with durationywherey < xSymptom
Panic
The issue seems to be that the track duration and progress numbers are updated at different times/places, so the app tries to update the progress bar with previous track's duration over the new track's duration, resulting in a panic from tui-rs's
Gaugewidget.Simply placing a bandage on the problem by limiting the percentage to 100% maximum elicits a panic in a different place for the same reason
where
github.com/Rigellute/spotify-tui@06d7b91164/src/ui/util.rs (L52)panics because of a negative unsigned result.