aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
3.45k stars 149 forks source link

CLI command to add tracks to a playlist #447

Open BenGale93 opened 5 months ago

BenGale93 commented 5 months ago

Is your feature already implemented in the latest master?

Not that I'm aware of.

Is your feature request related to a problem? Please describe.

I'd like to be able to quickly run a command in the CLI to add the current track to my main playlist. This is to reduce the amount of context switching I need to do when I decide I like the song.

Describe the solution you'd like

I have a very rough solution here: https://github.com/aome510/spotify-player/commit/b7bfa96dad2146863bbcbbf5380551c9479b5048

Additional context

The solution I have implemented messes with the current API quite badly, specifically passing state into the playlist command. Also, if you run the CLI command whilst the TUI player is open in another terminal the command will just hang and I'm not sure why.

Let me know if you are happy with this feature being included and I'll open a PR we can collaborate on.

BenGale93 commented 5 months ago

Managed to fix the CLI hanging issue by spawning a thread: https://github.com/aome510/spotify-player/compare/master...BenGale93:spotify-player:feat/add-to-playlist

Code is pretty hideous though. Will continue to work on that.

Sylvexn commented 3 months ago

Adding to this: Creating a shortcut for adding to Liked Songs as a hotkey as well as adding to specified playlist would be nice.