mirror of
https://github.com/Rigellute/spotify-tui.git
synced 2026-04-26 16:15:55 +03:00
[GH-ISSUE #16] Implement methods to control playback #15
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#15
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 @Ciavarella on GitHub (Oct 7, 2019).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/16
Would be awsome if you could add next and previous track.
I know that there is some issues with:
"The auth token does not currently automatically refresh - when you leave spotify-tui running for a while, you won't be able to control playback. And you'll need to quit and restart to get it working again."
I had the same issue, i checked if the current token is valid. You could probably do this in a nicer way but when a user signs in the first time you get:
The expires_in tells you when the access_token expires. You can use it to decide when to get a new access_token. Then use the refresh_token to get a new access_token.
You can renew the access_token by using a refresh_token. This token is provided to you when you first make the request to authenticate the user. You should save that refresh_token if you don't already do so. The refresh_token is valid forever but you can't control playback with the refresh_token.
To get a new access_token with the refresh_token: (JavaScript)
You will then get a new access_token that you can use to control playback.
Documentation from Spotify on how to use the refresh_token to access a new access_token.
https://developer.spotify.com/documentation/ios/guides/token-swap-and-refresh/
btw, love what you have made! Great work!
@jq-rs commented on GitHub (Oct 8, 2019):
Yes, next and previous song keyboard shortcuts would be awesome!
@Rigellute commented on GitHub (Oct 8, 2019):
I absolutely need to implement this.
In keeping with vim style key bindings, which do you think would work best?
;for next and,for previousnfor next andNfor previousIf you have any preferences, let me know!
@Rigellute commented on GitHub (Oct 8, 2019):
And regarding implementing auto refresh of tokens, I have a plan for it.
@tommilligan commented on GitHub (Oct 8, 2019):
Would like to help with this, I can either dive in or you can let me know when you have specific tasks that need doing.
My vote would be for
nandNfor playback bindings@Ciavarella commented on GitHub (Oct 8, 2019):
I would go with 2.
nfor next andNfor previous.Or why not
nfor next andpfor previous? Im not really a fan of uppercase commands.Github uses

nandp@gallagth commented on GitHub (Oct 8, 2019):
Following this, another vote for
nandp!@jq-rs commented on GitHub (Oct 8, 2019):
Another vote for
nandp.These are the Github peer review shortcuts too, so many of us know them by heart. As @Ciavarella already mentions.
@ohhskar commented on GitHub (Oct 9, 2019):
I vote for
nandNin keeping with vim style bindings.@Rigellute commented on GitHub (Oct 9, 2019):
Token refresh has now been implemented!
github.com/Rigellute/spotify-tui@df34c32143Will be available in the next release.
Huge thanks to @fangyi-zhou
@jq-rs commented on GitHub (Oct 10, 2019):
I am now missing also volume controls..
Token refresh and repeat works great!
@Rigellute commented on GitHub (Oct 13, 2019):
Playback controls update:
I'm going to close this issue and reopen one for controlling volume.