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

ihate: Use queries, not custom regexes #398

Closed
sampsyo opened this Issue Sep 26, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@sampsyo
Member

sampsyo commented Sep 26, 2013

The ihate plugin should use beets' query syntax instead of an ad-hoc regular expression system. There's no need for redundant "skip_artist" and "skip_album" when we could just use "skip: artist:foo".

@dokterbob

This comment has been minimized.

Show comment
Hide comment
@dokterbob

dokterbob Nov 7, 2013

Contributor

Proposal for the configuration file:

ihate:
    skip: artist:britney spears
    warn: album:tribute
    skip_whitelist: album:heroin
    warn_whitelist: artist:string band

In this case the logic would be something like this:

Skip? --- yes -> Skip whitelisted? --- yes -> add
          |                            `_ no -> skip
          `- no 

Warn? --- yes -> Warn whitelisted? --- yes -> add
       |                            `- no -> Confirm add --- yes -> add
       |                                                  `_ no -> skip
       `- no -> add

To implement this, we should be able to query whether or not a particular ImportTask object conforms to a particular Library query. Is there currently a way to do this?

Having browsed quickly through the code it seems as though we need to have the stuff in our database first before we would actually fire such a query. Does that make sense?

Contributor

dokterbob commented Nov 7, 2013

Proposal for the configuration file:

ihate:
    skip: artist:britney spears
    warn: album:tribute
    skip_whitelist: album:heroin
    warn_whitelist: artist:string band

In this case the logic would be something like this:

Skip? --- yes -> Skip whitelisted? --- yes -> add
          |                            `_ no -> skip
          `- no 

Warn? --- yes -> Warn whitelisted? --- yes -> add
       |                            `- no -> Confirm add --- yes -> add
       |                                                  `_ no -> skip
       `- no -> add

To implement this, we should be able to query whether or not a particular ImportTask object conforms to a particular Library query. Is there currently a way to do this?

Having browsed quickly through the code it seems as though we need to have the stuff in our database first before we would actually fire such a query. Does that make sense?

@sampsyo

This comment has been minimized.

Show comment
Hide comment
@sampsyo

sampsyo Nov 7, 2013

Member

Yes, this config structure looks right.

To test whether an object (Item or Album) satisfies a query, you don't need to add it to the database. Just write query.match(obj), which returns a boolean.

Member

sampsyo commented Nov 7, 2013

Yes, this config structure looks right.

To test whether an object (Item or Album) satisfies a query, you don't need to add it to the database. Just write query.match(obj), which returns a boolean.

@sampsyo sampsyo closed this in 67df43b Feb 8, 2014

dokterbob added a commit to dokterbob/beets that referenced this issue Mar 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment