[GH-ISSUE #103] feature suggestions/requests #41

Closed
opened 2026-03-02 23:43:57 +03:00 by kerem · 9 comments
Owner

Originally created by @sewnie on GitHub (Jan 9, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/103

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 with mpv.
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-player

  1. support querying of status, like in spotify-tui, with the ability for custom format:
λ spt playback
🔀 ▶ Warakumbla - Hypothermia
  1. support running a command on new song or supply current playing song, data, albumcover file, volume on music event to an external command via configuration, or a really over-engineered fifo.
Originally created by @sewnie on GitHub (Jan 9, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/103 ~~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 with `mpv.`~~ ~~2. display the album cover as braille; my usecase for this is with [st boxdraw](https://st.suckless.org/patches/boxdraw/), as it can render braille characters as block. (might be replaced by sixel)~~ viuer backend request, not spotify-player 1. support querying of status, like in spotify-tui, with the ability for custom format: ``` λ spt playback 🔀 ▶ Warakumbla - Hypothermia ``` 2. support running a command on new song or supply current playing song, data, albumcover file, volume on music event to an external command via configuration, or a really over-engineered fifo.
kerem 2026-03-02 23:43:57 +03:00
Author
Owner

@sewnie commented on GitHub (Jan 9, 2023):

2 - https://github.com/librespot-org/librespot/wiki/Events

<!-- gh-comment-id:1375523606 --> @sewnie commented on GitHub (Jan 9, 2023): 2 - https://github.com/librespot-org/librespot/wiki/Events
Author
Owner

@sewnie commented on GitHub (Jan 9, 2023):

   Compiling spotify_player v0.10.0 (/tmp/kiss/14173/build/spotify-player/spotify_player)
warning: function `get_track_album_image_url` is never used
  --> spotify_player/src/utils.rs:63:8
   |
63 | pub fn get_track_album_image_url(track: &rspotify::model::FullTrack) -> Option<&str> {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

this can fulfill feature request 1!

<!-- gh-comment-id:1375678869 --> @sewnie commented on GitHub (Jan 9, 2023): ``` Compiling spotify_player v0.10.0 (/tmp/kiss/14173/build/spotify-player/spotify_player) warning: function `get_track_album_image_url` is never used --> spotify_player/src/utils.rs:63:8 | 63 | pub fn get_track_album_image_url(track: &rspotify::model::FullTrack) -> Option<&str> { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ``` this can fulfill feature request 1!
Author
Owner

@sewnie commented on GitHub (Mar 19, 2023):

support running a command on new song or supply current playing song, data, albumcover file, volume on music event to an external command via configuration, or a really over-engineered fifo.

a workaround to this would be to wait for a new file in the album cover cache directory i guess?

<!-- gh-comment-id:1475128342 --> @sewnie commented on GitHub (Mar 19, 2023): > support running a command on new song or supply current playing song, data, albumcover file, volume on music event to an external command via configuration, or a really over-engineered fifo. a workaround to this would be to wait for a new file in the album cover cache directory i guess?
Author
Owner

@sewnie commented on GitHub (Sep 7, 2023):

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.

<!-- gh-comment-id:1710432440 --> @sewnie commented on GitHub (Sep 7, 2023): 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.
Author
Owner

@aome510 commented on GitHub (Sep 7, 2023):

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?

<!-- gh-comment-id:1710513390 --> @aome510 commented on GitHub (Sep 7, 2023): > 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?
Author
Owner

@aome510 commented on GitHub (Sep 7, 2023):

socket should be really fast. The slowness you see should mostly come from network request to get Spotify data.

<!-- gh-comment-id:1710514157 --> @aome510 commented on GitHub (Sep 7, 2023): socket should be really fast. The slowness you see should mostly come from network request to get Spotify data.
Author
Owner

@sewnie commented on GitHub (Sep 7, 2023):

Not sure how FIFO can be implemented as a way for CLI to communicate with another running client. Do you mind to elaborate?

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.

image

The slowness you see should mostly come from network request to get Spotify data.

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?

<!-- gh-comment-id:1710519968 --> @sewnie commented on GitHub (Sep 7, 2023): > Not sure how FIFO can be implemented as a way for CLI to communicate with another running client. Do you mind to elaborate? 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. ![image](https://github.com/aome510/spotify-player/assets/47404953/da24dd4d-6ecc-4894-900a-e649a2ac4d56) > The slowness you see should mostly come from network request to get Spotify data. 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?
Author
Owner

@aome510 commented on GitHub (Sep 7, 2023):

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 get commands. Please create an issue with description + observed runtime for get playback so that people can track it if you want get playback to be faster.

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.

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 /tmp/command, and client writes to /tmp/command_result?

<!-- gh-comment-id:1710529416 --> @aome510 commented on GitHub (Sep 7, 2023): > 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 `get` commands. Please create an issue with description + observed runtime for `get playback` so that people can track it if you want `get playback` to be faster. > 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. 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 `/tmp/command`, and client writes to `/tmp/command_result`?
Author
Owner

@sewnie commented on GitHub (Sep 7, 2023):

Forget the FIFO, i'd rather have the 'retrieve data remotely' problem gone, making a new issue

<!-- gh-comment-id:1710530459 --> @sewnie commented on GitHub (Sep 7, 2023): Forget the FIFO, i'd rather have the 'retrieve data remotely' problem gone, making a new issue
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-player#41
No description provided.