mcthomas / Apple-Music-CLI-Player

A simple command-line Apple Music controller script which includes a "Now Playing" widget function, a playback function, and a list-out function for your Mac's Music.app library, written in sh.
MIT License
107 stars 10 forks source link

Search for artist, album, song, playlist by pattern? #8

Closed ajkessel closed 5 months ago

ajkessel commented 6 months ago

Would you consider adding the ability to search for content by pattern? This would just require adding a command-line option that would accept a pattern and then grepping that pattern from the osascript output.

For example,

am list -a -r '.*Monk.*'

would search for every artist with the string "Monk" in it, which would capture "Thelonious Monk," as well as "The Thelonious Monk Quartet," etc.

Maybe easier to just have it be a substring rather than regexp match so -r 'monk' would return everything that has "monk" anywhere in it.

mcthomas commented 5 months ago

I think I might be confused. Currently you can fzf for an genre, playlist, artist, album, or song if you don't provide a pattern arg to the program's play cmd flags. Are you saying you'd want that same functionality for the list cmd?

ajkessel commented 5 months ago

I think I might be confused. Currently you can fzf for an genre, playlist, artist, album, or song if you don't provide a pattern arg to the program's play cmd flags. Are you saying you'd want that same functionality for the list cmd?

I think that is what I'm saying -- you can't fzf to see what's available, before picking what you want to play, right?

mcthomas commented 5 months ago

Sure you can, just execute:

play -s 
play -r 
play -a 
play -p 
play -g

And it takes you into fzf. You can send a kill sig if you want to abort. The List cmd doesn't currently have fzf integrated, because it is really just for dumping out the contents of a collection. Please let me know if I am totally misunderstanding.

ajkessel commented 5 months ago

Oh! I didn't realize that's how those options worked. To be honest, I haven't come across fzf before this. Perhaps you want to tweak the help description if the user doesn't know fzf.

mcthomas commented 5 months ago

I tried to make it clear with the usage list-out, indicating the no-arg variants pipe in fzf, but maybe that's not inherently obvious. Thank you for the suggestion!

ajkessel commented 5 months ago

My suggestion is just changing "fzf" to something like "interactive search" to clarify what it is doing.