[GH-ISSUE #791] Wrong title in command line when changing tracks #322

Open
opened 2026-02-28 14:48:30 +03:00 by kerem · 2 comments
Owner

Originally created by @nacht-falter on GitHub (Apr 17, 2021).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/791

When I change songs via the command line without UI, e.g. like this spt p --name monolake --artist the new track is played correctly, but sometimes the title of the track that has been playing before is printed to the terminal. It's not consistent though as this terminal output shows:

$ spt p --name monolake --artist
▶ Reminiscence - Monolake                   # correct
$ spt p --name muse --artist
▶ Reminiscence - Monolake                   # wrong
$ spt pb -t
⏸ Uprising - Muse                          # correct
$ spt p --name infinite\ snow --track 
☆ ▶ Infinite Snow - Monolake                # correct
$ spt p --name uprising --track
▶ Uprising - Muse                           # correct
$ spt p --name infinite\ snow --track
☆ ▶ Infinite Snow - Monolake                # correct 
$ spt p --name uprising --track
☆ ▶ Infinite Snow - Monolake                # wrong

(I am running spotify-tui 0.23.0 on macOS)

Originally created by @nacht-falter on GitHub (Apr 17, 2021). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/791 When I change songs via the command line without UI, e.g. like this `spt p --name monolake --artist` the new track is played correctly, but sometimes the title of the track that has been playing before is printed to the terminal. It's not consistent though as this terminal output shows: ``` $ spt p --name monolake --artist ▶ Reminiscence - Monolake # correct $ spt p --name muse --artist ▶ Reminiscence - Monolake # wrong $ spt pb -t ⏸ Uprising - Muse # correct $ spt p --name infinite\ snow --track ☆ ▶ Infinite Snow - Monolake # correct $ spt p --name uprising --track ▶ Uprising - Muse # correct $ spt p --name infinite\ snow --track ☆ ▶ Infinite Snow - Monolake # correct $ spt p --name uprising --track ☆ ▶ Infinite Snow - Monolake # wrong ``` (I am running spotify-tui 0.23.0 on macOS)
Author
Owner

@OrangeFran commented on GitHub (Apr 18, 2021):

This also caught my attention but I never bothered to fix it, sorry :/
I think spotify just needs some time to process and update the playback when we send a change song request. I tried waiting half a second with std::thread::sleep before querying the status and it seems that it displays the playback status consistently now, though it's probably not a good solution. Let me know if you find something better, else I'll open a pr.

Edit: https://github.com/Rigellute/spotify-tui/compare/master...OrangeFran:fix_song_status

<!-- gh-comment-id:821955861 --> @OrangeFran commented on GitHub (Apr 18, 2021): This also caught my attention but I never bothered to fix it, sorry :/ I think spotify just needs some time to process and update the playback when we send a `change song` request. I tried waiting half a second with `std::thread::sleep` before querying the status and it seems that it displays the playback status consistently now, though it's probably not a good solution. Let me know if you find something better, else I'll open a pr. Edit: https://github.com/Rigellute/spotify-tui/compare/master...OrangeFran:fix_song_status
Author
Owner

@nacht-falter commented on GitHub (Apr 19, 2021):

Looks good. Thx!

<!-- gh-comment-id:822398847 --> @nacht-falter commented on GitHub (Apr 19, 2021): Looks good. Thx!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#322
No description provided.