mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
Query string for computed fields. Fixes #693
This commit is contained in:
parent
4e2828668c
commit
b8687999e2
2 changed files with 2 additions and 8 deletions
|
|
@ -20,7 +20,6 @@ from beets.plugins import BeetsPlugin
|
|||
from beets import autotag, library, ui, util
|
||||
from beets.autotag import hooks
|
||||
from beets import config
|
||||
from beets import dbcore
|
||||
|
||||
log = logging.getLogger('beets')
|
||||
|
||||
|
|
@ -29,17 +28,12 @@ def mbsync_singletons(lib, query, move, pretend, write):
|
|||
"""Retrieve and apply info from the autotagger for items matched by
|
||||
query.
|
||||
"""
|
||||
singletons_query = library.get_query(query, library.Item)
|
||||
singletons_query.subqueries.append(
|
||||
dbcore.query.BooleanQuery('singleton', True)
|
||||
)
|
||||
for item in lib.items(singletons_query):
|
||||
for item in lib.items(query + ['singletons:true']):
|
||||
if not item.mb_trackid:
|
||||
log.info(u'Skipping singleton {0}: has no mb_trackid'
|
||||
.format(item.title))
|
||||
continue
|
||||
|
||||
|
||||
# Get the MusicBrainz recording info.
|
||||
track_info = hooks.track_for_mbid(item.mb_trackid)
|
||||
if not track_info:
|
||||
|
|
@ -118,7 +112,6 @@ def apply_item_changes(lib, item, move, pretend, write):
|
|||
item.store()
|
||||
|
||||
|
||||
|
||||
def mbsync_func(lib, opts, args):
|
||||
"""Command handler for the mbsync function.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ from helper import TestHelper,\
|
|||
|
||||
from beets.library import Item
|
||||
|
||||
|
||||
class MbsyncCliTest(unittest.TestCase, TestHelper):
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue