aome510 / spotify-player

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

Search from CLI #425

Closed davepgreene closed 5 months ago

davepgreene commented 5 months ago

Is your feature already implemented in the latest master? No

Is your feature request related to a problem? Please describe. Right now the current method for getting search-like information from Spotify via the CLI is to use spotify_player get item <TYPE> --name. Unfortunately this only returns a single result rather than the list of results that the TUI returns when searching.

Describe the solution you'd like A new CLI command called search which allows users to do the same kind of search that the TUI does.

Describe alternatives you've considered N/A

Additional context From poking through the codebase (I'm not super familiar with Rust so I'm sure I've missed something here) it looks like the CLI does item retrieval calls out directly to the artist, track, playlist, and track methods in rspotify. Would it be too much work to wire up the search method as well?

aome510 commented 5 months ago

Shouldn't be too difficult to define a search CLI command as client does provide search (https://github.com/aome510/spotify-player/blob/2b8f2530cba3c83f108dfc887f4666f356f8e86a/spotify_player/src/client/mod.rs#L832) and search_specific_type (https://github.com/aome510/spotify-player/blob/2b8f2530cba3c83f108dfc887f4666f356f8e86a/spotify_player/src/client/mod.rs#L880)

kadinsayani commented 5 months ago

Hi, I'd like to give this a try if that's okay with you? Thanks!

aome510 commented 5 months ago

yes, please do. Lmk when you have a PR up