mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Simplified search_ids logic: now uses sequence typing
This commit is contained in:
parent
24a1d93b0e
commit
9a03789e5e
1 changed files with 9 additions and 10 deletions
|
|
@ -259,7 +259,7 @@ def tag_album(
|
|||
items,
|
||||
search_artist: str = "",
|
||||
search_album: str = "",
|
||||
search_ids: Sequence[str] | None = None,
|
||||
search_ids: Sequence[str] = (),
|
||||
) -> tuple[str, str, Proposal]:
|
||||
"""Return a tuple of the current artist name, the current album
|
||||
name, and a `Proposal` containing `AlbumMatch` candidates.
|
||||
|
|
@ -288,7 +288,6 @@ def tag_album(
|
|||
candidates: dict[Any, AlbumMatch] = {}
|
||||
|
||||
# Search by explicit ID.
|
||||
if search_ids:
|
||||
for search_id in search_ids:
|
||||
log.debug("Searching for album ID: {}", search_id)
|
||||
if info := metadata_plugins.album_for_id(search_id):
|
||||
|
|
@ -297,7 +296,7 @@ def tag_album(
|
|||
plugins.send("album_matched", match=opt_candidate)
|
||||
|
||||
# Use existing metadata or text search.
|
||||
else:
|
||||
if not search_ids:
|
||||
# Try search based on current ID.
|
||||
if info := match_by_id(items):
|
||||
_add_candidate(items, candidates, info)
|
||||
|
|
@ -352,7 +351,7 @@ def tag_item(
|
|||
item: Item,
|
||||
search_artist: str = "",
|
||||
search_title: str = "",
|
||||
search_ids: list[str] | None = None,
|
||||
search_ids: Sequence[str] = (),
|
||||
) -> Proposal:
|
||||
"""Find metadata for a single track. Return a `Proposal` consisting
|
||||
of `TrackMatch` objects.
|
||||
|
|
|
|||
Loading…
Reference in a new issue