mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
musicbrainz: move handling of extra tags to musicbrainz plugin
This commit is contained in:
parent
de0958ca65
commit
a538a3a150
2 changed files with 10 additions and 15 deletions
|
|
@ -539,12 +539,6 @@ def tag_album(
|
|||
search_artist, search_album = cur_artist, cur_album
|
||||
log.debug("Search terms: {0} - {1}", search_artist, search_album)
|
||||
|
||||
extra_tags = None
|
||||
if config["musicbrainz"]["extra_tags"]:
|
||||
tag_list = config["musicbrainz"]["extra_tags"].get()
|
||||
extra_tags = {k: v for (k, v) in likelies.items() if k in tag_list}
|
||||
log.debug("Additional search terms: {0}", extra_tags)
|
||||
|
||||
# Is this album likely to be a "various artist" release?
|
||||
va_likely = (
|
||||
(not consensus["artist"])
|
||||
|
|
|
|||
|
|
@ -783,15 +783,16 @@ class MusicBrainzPlugin(BeetsPlugin):
|
|||
if track_count := len(items):
|
||||
criteria["tracks"] = str(track_count)
|
||||
|
||||
# Additional search cues from existing metadata.
|
||||
if extra_tags:
|
||||
for tag, value in extra_tags.items():
|
||||
key = FIELDS_TO_MB_KEYS[tag]
|
||||
value = str(value).lower().strip()
|
||||
if key == "catno":
|
||||
value = value.replace(" ", "")
|
||||
if value:
|
||||
criteria[key] = value
|
||||
if self.config["extra_tags"]:
|
||||
tag_list = self.config["extra_tags"].get()
|
||||
self._log.debug("Additional search terms: {0}", tag_list)
|
||||
for tag, value in tag_list.items():
|
||||
if key := FIELDS_TO_MB_KEYS.get(tag):
|
||||
value = str(value).lower().strip()
|
||||
if key == "catno":
|
||||
value = value.replace(" ", "")
|
||||
if value:
|
||||
criteria[key] = value
|
||||
|
||||
# Abort if we have no search terms.
|
||||
if not any(criteria.values()):
|
||||
|
|
|
|||
Loading…
Reference in a new issue