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:
Philippe Mongeau 2012-10-21 11:39:23 -04:00
parent e80dce6930
commit 78f2003eb0

View file

@ -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')