mirror of
https://github.com/beetbox/beets.git
synced 2026-01-09 09:22:55 +01:00
Add explanatory docstring
This commit is contained in:
parent
724b06a77d
commit
699e12bd88
1 changed files with 9 additions and 0 deletions
|
|
@ -45,6 +45,15 @@ log = logging.getLogger('beets')
|
|||
# Library-specific query types.
|
||||
|
||||
class SingletonQuery(dbcore.FieldQuery):
|
||||
"""This query is responsible for the 'singleton' lookup.
|
||||
|
||||
It is based on the FieldQuery and constructs a SQL clause
|
||||
'album_id is NULL' which yields the same result as the previous filter
|
||||
in Python but is more performant since it's done in SQL.
|
||||
|
||||
Using util.str2bool ensures that lookups like singleton:true, singleton:1
|
||||
and singleton:false, singleton:0 are handled consistently.
|
||||
"""
|
||||
def __new__(cls, field, value, *args, **kwargs):
|
||||
query = dbcore.query.NoneQuery('album_id')
|
||||
if util.str2bool(value):
|
||||
|
|
|
|||
Loading…
Reference in a new issue