mirror of
https://github.com/beetbox/beets.git
synced 2025-12-20 15:43:58 +01:00
initial support for non-field queries
With this change, we can get slightly closer to letting plugins extend the query syntax with queries that don't pertain to a specific field. This will likely need some more tweaking in the future, but it should allow for some very interesting things.
This commit is contained in:
parent
79c79bfcc3
commit
d0e9e3db1e
1 changed files with 7 additions and 2 deletions
|
|
@ -768,9 +768,14 @@ def construct_query_part(query_part, default_fields, all_keys):
|
|||
if os.sep in pattern and 'path' in all_keys:
|
||||
# This looks like a path.
|
||||
return PathQuery(pattern)
|
||||
else:
|
||||
# Match any field.
|
||||
elif issubclass(query_class, FieldQuery):
|
||||
# The query type matches a specific field, but none was
|
||||
# specified. So we use a version of the query that matches
|
||||
# any field.
|
||||
return AnyFieldQuery(pattern, default_fields, query_class)
|
||||
else:
|
||||
# Other query type.
|
||||
return query_class(pattern)
|
||||
|
||||
# A boolean field.
|
||||
elif key.lower() == 'comp':
|
||||
|
|
|
|||
Loading…
Reference in a new issue