mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +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
|
from beets.util import displayable_path, normpath, syspath
|
||||||
|
|
||||||
|
|
||||||
def tag_data(opts, lib, args):
|
def tag_data(lib, args, album=False):
|
||||||
query = []
|
query = []
|
||||||
for arg in args:
|
for arg in args:
|
||||||
path = normpath(arg)
|
path = normpath(arg)
|
||||||
|
|
@ -69,8 +69,8 @@ def tag_data_emitter(path):
|
||||||
return emitter
|
return emitter
|
||||||
|
|
||||||
|
|
||||||
def library_data(opts, lib, args):
|
def library_data(lib, args, album=False):
|
||||||
for item in lib.albums(args) if opts.album else lib.items(args):
|
for item in lib.albums(args) if album else lib.items(args):
|
||||||
yield library_data_emitter(item)
|
yield library_data_emitter(item)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -203,7 +203,10 @@ class InfoPlugin(BeetsPlugin):
|
||||||
|
|
||||||
first = True
|
first = True
|
||||||
summary = {}
|
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:
|
try:
|
||||||
data, item = data_emitter(included_keys or '*')
|
data, item = data_emitter(included_keys or '*')
|
||||||
except (mediafile.UnreadableFileError, OSError) as ex:
|
except (mediafile.UnreadableFileError, OSError) as ex:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue