mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Switch "beet info --album" approach to use a named argument instead
These functions are also used by the export plugin, so it's useful if the signature stays backwards compatible.
This commit is contained in:
parent
5c41478263
commit
a5b5831d28
1 changed files with 7 additions and 4 deletions
|
|
@ -25,7 +25,7 @@ from beets.library import Item
|
|||
from beets.util import displayable_path, normpath, syspath
|
||||
|
||||
|
||||
def tag_data(opts, lib, args):
|
||||
def tag_data(lib, args, album=False):
|
||||
query = []
|
||||
for arg in args:
|
||||
path = normpath(arg)
|
||||
|
|
@ -69,8 +69,8 @@ def tag_data_emitter(path):
|
|||
return emitter
|
||||
|
||||
|
||||
def library_data(opts, lib, args):
|
||||
for item in lib.albums(args) if opts.album else lib.items(args):
|
||||
def library_data(lib, args, album=False):
|
||||
for item in lib.albums(args) if album else lib.items(args):
|
||||
yield library_data_emitter(item)
|
||||
|
||||
|
||||
|
|
@ -203,7 +203,10 @@ class InfoPlugin(BeetsPlugin):
|
|||
|
||||
first = True
|
||||
summary = {}
|
||||
for data_emitter in data_collector(opts, lib, ui.decargs(args)):
|
||||
for data_emitter in data_collector(
|
||||
lib, ui.decargs(args),
|
||||
album=opts.album,
|
||||
):
|
||||
try:
|
||||
data, item = data_emitter(included_keys or '*')
|
||||
except (mediafile.UnreadableFileError, OSError) as ex:
|
||||
|
|
|
|||
Loading…
Reference in a new issue