mirror of
https://github.com/beetbox/beets.git
synced 2026-06-09 20:50:46 -04:00
Query string for computed fields. Fixes #693
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user