losnoco / Cog

Cog - A Free and Open Source Audio Player for macOS 10.13+
https://cog.losno.co
GNU General Public License v2.0
696 stars 45 forks source link

Integrate SpotLight Search in the main UI [Feature Request] #154

Open JuanDouek opened 3 years ago

JuanDouek commented 3 years ago

Hi, it would be wonderful to be able to search from the search box in the toolbar and filter the File Tree also. Thank you very much for this incredible music player.

Just for the fun, here it is my Cog setup: Captura de Pantalla 2021-05-12 a la(s) 13 02 34

nevack commented 3 years ago

Nice idea!

kode54 commented 2 years ago

I will try to implement this tomorrow. Basically, I'm gonna hook into the spotlight's value, and attempt to implement a quick search against all leaf nodes in the tree view, adding any matching leaves and all their parent items up to the root to a match tree, in a unique fashion so each item is only added to the list once. Then adding non-matching items and their parents in the same unique fashion to a hide list. Then iterating over the show list and removing any of its referenced nodes from the hide list. Then doing hide/show mechanics on the tree items based on their membership in these two arrays. Assuming a tree view like this supports setHidden:YES/NO like NSViews do.

kode54 commented 2 years ago

Assuming I somehow get around to doing this, I think it would be better to make a separate search field for the file tree, as the playlist tends to misbehave a bit if you're adding files to it while a search filter is active, as every time you apply a search filter, it rewrites the playlist indexes for the visible items so they're all in linear order, removing the gaps formed by the hidden items.

JuanDouek commented 2 years ago

If thats the case, maybe there could be a different widget that you can add to the toolbar, so you can choose the one you prefer. Or even better: clicking the loupe pops a menu to choose if you want to search the file tree or the playlist.

knaccc commented 1 year ago

First, thank you SO MUCH for creating Cog - I've been looking for a replacement for Clementine for years, and your approach really understands that some people just want to manage their music as a set of folders on disk. Your approach to clean and simple UI design is outstanding.

The only thing that separates Cog from perfection for me is the lack of a search feature that is integrated into the main window, which will locate an album name or folder name (the on-disk name, not the mp3 metadata name).

The Spotlight panel lets me search for an album, but then I need to select a group of files from that album before adding it into a playlist, instead of just clicking to add a particular album name.

In fact, it's rare that I ever do anything other than search for and add an entire album. I hardly ever need to search for and add individual songs.

Thanks again, and I can't wait to see how you decide to evolve the app!