mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 02:52:33 +01:00
fix searching when to tags are present
This commit is contained in:
parent
def0f2c0e5
commit
00e7523374
3 changed files with 9 additions and 2 deletions
|
|
@ -117,7 +117,8 @@ def _item_candidates(item, artist, title):
|
|||
out = []
|
||||
|
||||
# MusicBrainz candidates.
|
||||
out.extend(mb.match_track(artist, title))
|
||||
if artist and title:
|
||||
out.extend(mb.match_track(artist, title))
|
||||
|
||||
# Plugin candidates.
|
||||
out.extend(plugins.item_candidates(item))
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ releases and tracks.
|
|||
"""
|
||||
import logging
|
||||
import re
|
||||
import copy
|
||||
from munkres import Munkres
|
||||
from unidecode import unidecode
|
||||
|
||||
|
|
|
|||
|
|
@ -157,6 +157,10 @@ def match_album(artist, album, tracks=None, limit=SEARCH_LIMIT):
|
|||
if tracks is not None:
|
||||
criteria['tracks'] = str(tracks)
|
||||
|
||||
# Abort if we have no search terms.
|
||||
if not any(criteria.itervalues()):
|
||||
return
|
||||
|
||||
_adapt_criteria(criteria)
|
||||
res = musicbrainz3.release_search(limit=limit, **criteria)
|
||||
for release in res['release-list']:
|
||||
|
|
@ -173,6 +177,9 @@ def match_track(artist, title, limit=SEARCH_LIMIT):
|
|||
'recording': title,
|
||||
}
|
||||
|
||||
if not any(criteria.itervalues()):
|
||||
return
|
||||
|
||||
_adapt_criteria(criteria)
|
||||
res = musicbrainz3.recording_search(limit=limit, **criteria)
|
||||
for recording in res['recording-list']:
|
||||
|
|
|
|||
Loading…
Reference in a new issue