-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Music Player Progress Bar Not Updating Correctly When Paused with Spotify And Local Media Players #107
Comments
Looks like this issue goes as deep as coming from the MediaRemote library nowplaying-cli is using to retrieve this information. There's also an issue on the nowplaying-cli issue tracker that mirrors this issue: kirtan-shah/nowplaying-cli#15 Code is pretty straight-forward though, they're just getting the data and spitting it out. So unless apple decides to change this behavior, I think we're stuck fixing this somewhere downstream. I took the obvious approach and just use a temp file to "fix" it. index 6f25b4e..44ad6c1 100755
--- a/src/music-tmux-statusbar.sh
+++ b/src/music-tmux-statusbar.sh
@@ -72,6 +72,12 @@ elif command -v nowplaying-cli >/dev/null; then
else
DURATION=$(printf "%.0f" "${NPCLI_VALUES[duration]}")
POSITION=$(printf "%.0f" "${NPCLI_VALUES[elapsedTime]}")
+ if [ "$STATUS" = "playing" ]; then
+ echo "$POSITION" >/tmp/last_position
+ fi
+ if [ "$STATUS" = "paused" ]; then
+ POSITION=$(cat /tmp/last_position)
+ fi
fi
fi |
Hi, I added this fix to the |
Yep, looks good to me 👍 |
Thanks for the feedback! |
The issue:
The music player widget in the Tokyo Night Tmux theme's status bar continues to update the progress bar and time even when the music is paused. This results in incorrect display of the music progress when the player is not actively playing music.
Steps to reproduce the issue:
Screenshots:
Environment:
Notes:
The text was updated successfully, but these errors were encountered: