Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upihate: Use queries, not custom regexes #398
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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 bandIn 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?
|
Proposal for the configuration file: ihate:
skip: artist:britney spears
warn: album:tribute
skip_whitelist: album:heroin
warn_whitelist: artist:string bandIn this case the logic would be something like this:
To implement this, we should be able to query whether or not a particular 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? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
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 |
sampsyo commentedSep 26, 2013
The
ihateplugin 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".