mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
matching: replace search_title, search_album with search_name
This commit is contained in:
parent
3731142d13
commit
612ffa0dde
1 changed files with 9 additions and 9 deletions
|
|
@ -242,7 +242,7 @@ def _add_candidate(
|
||||||
def tag_album(
|
def tag_album(
|
||||||
items,
|
items,
|
||||||
search_artist: str | None = None,
|
search_artist: str | None = None,
|
||||||
search_album: str | None = None,
|
search_name: str | None = None,
|
||||||
search_ids: list[str] = [],
|
search_ids: list[str] = [],
|
||||||
) -> tuple[str, str, Proposal]:
|
) -> tuple[str, str, Proposal]:
|
||||||
"""Return a tuple of the current artist name, the current album
|
"""Return a tuple of the current artist name, the current album
|
||||||
|
|
@ -303,10 +303,10 @@ def tag_album(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Search terms.
|
# Search terms.
|
||||||
if not (search_artist and search_album):
|
if not (search_artist and search_name):
|
||||||
# No explicit search terms -- use current metadata.
|
# No explicit search terms -- use current metadata.
|
||||||
search_artist, search_album = cur_artist, cur_album
|
search_artist, search_name = cur_artist, cur_album
|
||||||
log.debug("Search terms: {} - {}", search_artist, search_album)
|
log.debug("Search terms: {} - {}", search_artist, search_name)
|
||||||
|
|
||||||
# Is this album likely to be a "various artist" release?
|
# Is this album likely to be a "various artist" release?
|
||||||
va_likely = (
|
va_likely = (
|
||||||
|
|
@ -318,7 +318,7 @@ def tag_album(
|
||||||
|
|
||||||
# Get the results from the data sources.
|
# Get the results from the data sources.
|
||||||
for matched_candidate in metadata_plugins.candidates(
|
for matched_candidate in metadata_plugins.candidates(
|
||||||
items, search_artist, search_album, va_likely
|
items, search_artist, search_name, va_likely
|
||||||
):
|
):
|
||||||
_add_candidate(items, candidates, matched_candidate)
|
_add_candidate(items, candidates, matched_candidate)
|
||||||
if opt_candidate := candidates.get(matched_candidate.album_id):
|
if opt_candidate := candidates.get(matched_candidate.album_id):
|
||||||
|
|
@ -334,7 +334,7 @@ def tag_album(
|
||||||
def tag_item(
|
def tag_item(
|
||||||
item,
|
item,
|
||||||
search_artist: str | None = None,
|
search_artist: str | None = None,
|
||||||
search_title: str | None = None,
|
search_name: str | None = None,
|
||||||
search_ids: list[str] | None = None,
|
search_ids: list[str] | None = None,
|
||||||
) -> Proposal:
|
) -> Proposal:
|
||||||
"""Find metadata for a single track. Return a `Proposal` consisting
|
"""Find metadata for a single track. Return a `Proposal` consisting
|
||||||
|
|
@ -376,12 +376,12 @@ def tag_item(
|
||||||
|
|
||||||
# Search terms.
|
# Search terms.
|
||||||
search_artist = search_artist or item.artist
|
search_artist = search_artist or item.artist
|
||||||
search_title = search_title or item.title
|
search_name = search_name or item.title
|
||||||
log.debug("Item search terms: {} - {}", search_artist, search_title)
|
log.debug("Item search terms: {} - {}", search_artist, search_name)
|
||||||
|
|
||||||
# Get and evaluate candidate metadata.
|
# Get and evaluate candidate metadata.
|
||||||
for track_info in metadata_plugins.item_candidates(
|
for track_info in metadata_plugins.item_candidates(
|
||||||
item, search_artist, search_title
|
item, search_artist, search_name
|
||||||
):
|
):
|
||||||
dist = track_distance(item, track_info, incl_artist=True)
|
dist = track_distance(item, track_info, incl_artist=True)
|
||||||
candidates[track_info.track_id] = hooks.TrackMatch(dist, track_info)
|
candidates[track_info.track_id] = hooks.TrackMatch(dist, track_info)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue