Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean "not" operator in queries #819

Closed
kript opened this issue Jun 12, 2014 · 4 comments
Closed

Boolean "not" operator in queries #819

kript opened this issue Jun 12, 2014 · 4 comments
Labels
feature features we would like to implement

Comments

@kript
Copy link

kript commented Jun 12, 2014

I'd like to be able to do reverse matching regex in beets so I can create smart playlists with one or more specific exclusions, i.e.;

beet list ^(?!undesirable)$

or

smartplaylist:
playlists:
- name: notaudiobooks.m3u
query: 'genre:^(?!(audiobook)|(spoken))$'

@sampsyo sampsyo changed the title Reverse Regex for queries request Boolean "not" operator in queries Jun 12, 2014
@sampsyo
Copy link
Member

sampsyo commented Jun 12, 2014

Sorry, I didn't quite make this clear over twitter: you can probably use regexes to do negation today using that syntax. Have you tried something like

beet list genre::^(?!audiobook)$

or something similar? (Note the double colon to enable regex search.)

What we should add is explicit support for the "not" operator in queries so that silly regex hacks like this are not necessary.

@kript
Copy link
Author

kript commented Jun 12, 2014

Ah; I couldn't get that to work, I swear, but this now does;

beet ls genre::^'(?!kids)'

so, hurrah! and thank you, but having the not operator would be even nicer. :-)

@Profpatsch
Copy link
Member

Syntax ideas:

Example: I want to find all album by artist Evanescence, but not their album “Evanescence”:

beet list "artist:evanescence -album:evanescence"

or maybe

beet list "artist:evanescence not album:evanescence"

@sampsyo
Copy link
Member

sampsyo commented Nov 20, 2015

Added in #1728.

@sampsyo sampsyo closed this as completed Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

No branches or pull requests

3 participants