mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
simplify the random print code
We don't need the 'if opts.album' since we print with the same function and argsuments.
This commit is contained in:
parent
e80dce6930
commit
78f2003eb0
1 changed files with 2 additions and 6 deletions
|
|
@ -34,12 +34,8 @@ def random_item(lib, config, opts, args):
|
||||||
number = min(len(objs), opts.number)
|
number = min(len(objs), opts.number)
|
||||||
objs = random.sample(objs, number)
|
objs = random.sample(objs, number)
|
||||||
|
|
||||||
if opts.album:
|
for item in objs:
|
||||||
for album in objs:
|
print_obj(item, lib, config, template)
|
||||||
print_obj(album, lib, config, template)
|
|
||||||
else:
|
|
||||||
for item in objs:
|
|
||||||
print_obj(item, lib, config, template)
|
|
||||||
|
|
||||||
random_cmd = Subcommand('random',
|
random_cmd = Subcommand('random',
|
||||||
help='chose a random track or album')
|
help='chose a random track or album')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue