-
Notifications
You must be signed in to change notification settings - Fork 302
Implement spotify-player's CLI commands
#159
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
Conversation
also implement handlers for playback `seek` and `volume` commands
|
@apprehensions @diegoulloao, sorry for the long delay. I've added several CLI commands to You can run |
|
Man this is amazing! Just now I'm tied up with tasks but I'm going study the CLI on the next weekend and I'll quickly test it in the next days. From next weekend I'm going to start coding some little tests from a brand new neovim plugin. I want to thank you for this, it opens a lot of doors. Any other missed command or idea I'll let you know of course. |
misc: solves #77 as |
Updated 2 and 4.
Yeah, I'm aware of this problem as the CLI code still shares some startup codes as the normal app. It can be optimized ofc, but I'm not too sure about the improvement. Now, FYI, running
I don't get what you meant here, can you elaborate? |
i suggest renaming it to
sorry, i think i worded incorrectly; i said as one external command, not to replace them. i think some scripting users might be a little bit upset but this technically doesnt hurt when 5 is implemented
via the function (or similar) |
updated. Also change
By writing a script, you can get the same thing with |
Look like a big time difference between yours and mine, I'll try to run it on my older machine to see if I have the same result. |
i have a 20 thread cpu................ |
Okay, so something must be wrong here xD. Will try to figure it out. |
|
is it possible, that spotify-player, if it is already running, to access its own MPRIS data? this can give a significant speed boost when querying its metadata; since spotify_player (presumably) will request spotify api. this is equivalent to querying its data with |
Actually, not much of a difference. I just overlooked the I took a deeper look, it seemed the bottleneck is session initialization (~1s on each run). This session is required to send a spotify API and cannot be optimized as far as I understand. Another approach is setting IPC between the CLI program and a running spotify_player, which is more complicated but probably faster as it doesn't involve session initialization. |
I still suggest having to self-request MPRIS data, as it's very simple and isn't over-engineered as MPRIS is going to be equivalent of what the IPC would provide, mainly because D-Bus is a huge IPC lol.
About this, i suggest having the old method of needing session initialization when there is no D-Bus feature built with spotify-player, or when there is no device of spotify-player running already. |
The problem is that not all spotify data is encoded in MPRIS data and MPRIS only works on Linux.
Feels too hacky to me tbh. |
The MPRIS from spotify-player is enough.
You would still have to implement a way to use them on other operating systems? unless there is a library of course.
Meh. |
|
hi is there anything new about this or is it still being developed? |
|
@apprehensions I’m quite busy recently because of school. Will get back to this later this month |
|
I'm new to
By default I usually listen to my liked songs on shuffle so the first command is useful. For volume, the feature is on Android allowing the volume rocker to increase/decrease the volume of other devices Spotify playback. It would allow me to bind scroll wheel + button to turn up or down Spotfy volume. |
|
I'm also realizing the ability to "like" and "unlike" a track are missing from the cli. Something similar to these commands might be helpful:
This would allow me to add a new song to my Liked Songs with a window manager key bind. Another feature that would be nice but might be asking a lot would be to start playing a Artist / Album / Track Radio using a CLI command. An example command could be: This might help to explore new music and pair with the like command to accumulate new liked tracks. |
|
@apprehensions updated the codes to use socket programming for IPCs. Running the commands should be much faster now. |
|
@apprehensions can you confirm if the new changes improve the CLI performance? |
I'll merge the PR for now as it's first iteration of the app's CLI commands. Additional commands/features can be implemented in a follow-up PR. |
|
@aome510 i noticed you're using network sockets for requests? i don't know what exactly this is, but retrieving playback data takes a while: i sort of expected it to be somewhat instant, maybe try using a FIFO? or IPC? |
Resolves #111.
Partially #103.
Changes
Added CLI commands and subcommands
get:get key:get contextplayback