def move_func(lib, config, opts, args): dest = opts.dest if dest is not None: dest = normpath(dest) if not os.path.isdir(dest): raise ui.UserError('no such directory: %s' % dest) move_items(lib, dest, decargs(args), opts.copy, opts.album)
def list_func(lib, config, opts, args): fmt = opts.format if not fmt: # If no format is specified, fall back to a default. if opts.album: fmt = ui.config_val(config, 'beets', 'list_format_album', DEFAULT_LIST_FORMAT_ALBUM) else: fmt = ui.config_val(config, 'beets', 'list_format_item', DEFAULT_LIST_FORMAT_ITEM) list_items(lib, decargs(args), opts.album, opts.path, fmt)
def modify_func(lib, config, opts, args): args = decargs(args) mods = [a for a in args if '=' in a] query = [a for a in args if '=' not in a] if not mods: raise ui.UserError('no modifications specified') write = opts.write if opts.write is not None else \ ui.config_val(config, 'beets', 'import_write', DEFAULT_IMPORT_WRITE, bool) color = ui.config_val(config, 'beets', 'color', DEFAULT_COLOR, bool) modify_items(lib, mods, query, write, opts.move, opts.album, color, not opts.yes)
def remove_func(lib, config, opts, args): remove_items(lib, decargs(args), opts.album, opts.delete)
def update_func(lib, config, opts, args): color = ui.config_val(config, 'beets', 'color', DEFAULT_COLOR, bool) update_items(lib, decargs(args), opts.album, opts.move, color, opts.pretend)
def list_func(lib, config, opts, args): list_items(lib, decargs(args), opts.album, opts.path, opts.format)
def stats_func(lib, config, opts, args): show_stats(lib, decargs(args))