Skip to content

Commit 02bb8ec

Browse files
committed
matching: replace search_title, search_album with search_name
1 parent 26bfd75 commit 02bb8ec

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

beets/autotag/match.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def _add_candidate(
242242
def tag_album(
243243
items,
244244
search_artist: str | None = None,
245-
search_album: str | None = None,
245+
search_name: str | None = None,
246246
search_ids: list[str] = [],
247247
) -> tuple[str, str, Proposal]:
248248
"""Return a tuple of the current artist name, the current album
@@ -303,10 +303,10 @@ def tag_album(
303303
)
304304

305305
# Search terms.
306-
if not (search_artist and search_album):
306+
if not (search_artist and search_name):
307307
# No explicit search terms -- use current metadata.
308-
search_artist, search_album = cur_artist, cur_album
309-
log.debug("Search terms: {} - {}", search_artist, search_album)
308+
search_artist, search_name = cur_artist, cur_album
309+
log.debug("Search terms: {} - {}", search_artist, search_name)
310310

311311
# Is this album likely to be a "various artist" release?
312312
va_likely = (
@@ -318,7 +318,7 @@ def tag_album(
318318

319319
# Get the results from the data sources.
320320
for matched_candidate in metadata_plugins.candidates(
321-
items, search_artist, search_album, va_likely
321+
items, search_artist, search_name, va_likely
322322
):
323323
_add_candidate(items, candidates, matched_candidate)
324324
if opt_candidate := candidates.get(matched_candidate.album_id):
@@ -334,7 +334,7 @@ def tag_album(
334334
def tag_item(
335335
item,
336336
search_artist: str | None = None,
337-
search_title: str | None = None,
337+
search_name: str | None = None,
338338
search_ids: list[str] | None = None,
339339
) -> Proposal:
340340
"""Find metadata for a single track. Return a `Proposal` consisting
@@ -376,12 +376,12 @@ def tag_item(
376376

377377
# Search terms.
378378
search_artist = search_artist or item.artist
379-
search_title = search_title or item.title
380-
log.debug("Item search terms: {} - {}", search_artist, search_title)
379+
search_name = search_name or item.title
380+
log.debug("Item search terms: {} - {}", search_artist, search_name)
381381

382382
# Get and evaluate candidate metadata.
383383
for track_info in metadata_plugins.item_candidates(
384-
item, search_artist, search_title
384+
item, search_artist, search_name
385385
):
386386
dist = track_distance(item, track_info, incl_artist=True)
387387
candidates[track_info.track_id] = hooks.TrackMatch(dist, track_info)

0 commit comments

Comments
 (0)