-
Notifications
You must be signed in to change notification settings - Fork 152
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
feature suggestions/requests #103
Comments
This comment was marked as outdated.
This comment was marked as outdated.
a workaround to this would be to wait for a new file in the album cover cache directory i guess? |
Resolves #111. Partially #103. ## Changes Added CLI commands and subcommands: - `get`: ``` Get spotify data Usage: spotify_player get <COMMAND> Commands: key Get data by key context Get context data help Print this message or the help of the given subcommand(s) Options: -h, --help Print help ``` - `get key`: ``` Get data by key Usage: spotify_player get key <key> Arguments: <key> [possible values: playback, devices, user-playlists, user-liked-tracks, user-saved-albums, user-followed-artists, user-top-tracks, queue] Options: -h, --help Print help ``` - `get context` ``` Get context data Usage: spotify_player get context <context_type> <context_id> Arguments: <context_type> [possible values: playlist, album, artist] <context_id> Options: -h, --help Print help ``` - `playback` ``` Interact with the playback Usage: spotify_player playback <COMMAND> Commands: play Start a playback resume Resume the playback pause Pause the playback next Next track previous Previous track shuffle Toggle the shuffle mode repeat Cycle the repeat mode volume Set playback's volume percentage seek Seek the playback by an offset help Print this message or the help of the given subcommand(s) Options: -h, --help Print help ```
I found a workaround to the slow cli commands, which is to use the new hooks feature to output the tracks name to a file in ~/.cache, and have a seperate program read it. I'm still unsure why spotify-player uses a network socket; it should be using a FIFO as its much faster than performing a network request. |
Not sure how FIFO can be implemented as a way for CLI to communicate with another running client. Do you mind to elaborate? |
socket should be really fast. The slowness you see should mostly come from network request to get Spotify data. |
You could make a FIFO at /tmp, have a program write a command to it (such as 'get playback'), and that program will read from the FIFO after writing, in which case spotify_player will get that command, and write to the FIFO, which the program will retrieve.
Wait what? Why is this done? Shouldn't spotify_player store the current playing song? Why is this required for retrieving data that is already available? |
Yes, playback, specifically, can be parsed from the application's state so don't really need to make an API call. Getting playback through an API call was implemented for the first iteration because it's simpler and similar to the way the client handles other
If client and server both write to the same file, how does one differentiate between the other? Do you mean client and server have different FIFO file, server writes to |
Forget the FIFO, i'd rather have the 'retrieve data remotely' problem gone, making a new issue |
1. download the current playing song's album cover into a file or into a cache for another script to use; my usecase for this is to display the album cover with an image viewer, as i missed this feature from playing music withmpv.
2. display the album cover as braille; my usecase for this is with st boxdraw, as it can render braille characters as block. (might be replaced by sixel)viuer backend request, not spotify-playerThe text was updated successfully, but these errors were encountered: