query-based fix for #693

This is @geigerzaehler's fix from b868799, just with the typo fixed
(singletons -> singleton).

An alternate (more verbose) fix would have been:

    singletons_query.subqueries.append(
        dbcore.query.BooleanQuery('singleton', True, False)
    )

i.e., pass `False` for the `fast` parameter to indicate that this is not a
fixed-field query.
This commit is contained in:
Adrian Sampson 2014-04-16 10:18:38 -07:00
parent d02dec8364
commit de1247c7bc

View file

@ -28,9 +28,7 @@ def mbsync_singletons(lib, query, move, pretend, write):
"""Retrieve and apply info from the autotagger for items matched by
query.
"""
for item in lib.items(query):
if not item.singleton:
continue
for item in lib.items(query + ['singleton:true']):
if not item.mb_trackid:
log.info(u'Skipping singleton {0}: has no mb_trackid'
.format(item.title))