reupen / columns_ui

Alternative UI for the foobar2000 audio player
https://yuo.be/columns-ui
GNU Lesser General Public License v3.0
523 stars 32 forks source link

Filter panel: Add support for AND and NOT type of selections #26

Open Daeron08 opened 8 years ago

Daeron08 commented 8 years ago

Suppose filters panels are used with multivalue GENRE tags. Our library contains these tracks:

Track1 is tagged as GENRE='Rock; Electronic; Instrumental'. Track2 is tagged as GENRE='Rock; Classical, Instrumental'.

Filter panels in its current iteration operates on an OR basis. Should I highlight 'Classical' and 'Instrumental' (on a filter panel that lists the possible values of GENRE), the subsequent filter panels would list tracks that contain 'Classical' OR 'Instrumental'. Those are Track1 & Track2.

I would like a setting which would allow the usage of AND or NOT instead (on a per panel basis).

For example, while the panel is set to 'AND' mode, the results of highlighting 'Classical' and 'Instrumental' would be only tracks that contain both. Meaning only Track2.

In case the panel is set to 'NOT', a selection of 'Classical' and 'Instrumental' would result in no tracks shown in subsequent panels. That is because both Track1 or Track2 contains either 'Classical' or 'Instrumental' (or both).

Daeron08 commented 7 years ago

Also, if this simplifies it at all, I'd be happy with just a checkbox which would set the specific filter panel to operate in 'NOT' mode.

Suppose I have all my music tagged with multiple genres, and I want to retrieve all my 'Rock' tracks but make sure there won't be any 'Electronic' tracks. I can do that with library search and this code: %genre% HAS Rock AND NOT %genre% HAS Electronic

But I can't do this with filter panels as far as I know. It would be very useful to have one filter panel be able to list all my genres and I could select the ones I specifically don't want from a subsequent panel.

reupen commented 7 years ago

Hi,

I haven't had much free time lately, but I'm hoping to have more soon.

In relation to NOT, something that should work currently is pressing Ctrl+A in the panel and then Ctrl-clicking the All entry plus any additional ones you want to exclude. I could probably make Ctrl-A exclude the All node by default as well.

Daeron08 commented 7 years ago

No worries, I already am greatly thankful to have the things you made as-is. I was just putting the idea out there in case you happen to have free time and can't think of anything else better to do. I mostly just wanted to revise my original idea to be more specific.

What you suggested breaks when we are talking about GENRE='Rock; Electronic; Genre3; Genre4' kind of multivalue tags. If you have Rock highlighted while Electronic (and All entry) unselected, you will still get these mixed tracks in the playlist (which makes complete sense given how the panels currently work).

reupen commented 7 years ago

Ah, of course. Thanks for correcting me.