From 1ebe1cf728c65b9e47f2682a98169823aea5b9b5 Mon Sep 17 00:00:00 2001 From: Matteo Mecucci Date: Sun, 15 Apr 2012 16:28:12 +0200 Subject: [PATCH 1/4] Added fields command to output a list of available fields for queries and format strings. --- beets/ui/commands.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 061fc3ab9..0895e6142 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -84,6 +84,19 @@ def _showdiff(field, oldval, newval, color): print_(u' %s: %s -> %s' % (field, oldval, newval)) +# fields: Shows a list of available fields for queries and format strings. +fields_cmd = ui.Subcommand('fields', + help='show fields available for queries and format strings') +def fields_func(lib, config, opts, args): + print "Available item fields:" + print " " + "\n ".join([key for key in library.ITEM_KEYS]) + print "\nAvailable album fields:" + print " " + "\n ".join([key for key in library.ALBUM_KEYS]) + +fields_cmd.func = fields_func +default_commands.append(fields_cmd) + + # import: Autotagger and importer. DEFAULT_IMPORT_COPY = True From 43cebabcb62a79e1c0e4216fac69611bafa213de Mon Sep 17 00:00:00 2001 From: Matteo Mecucci Date: Sat, 31 Mar 2012 20:30:04 +0200 Subject: [PATCH 2/4] Added sorting in listing command of bpd --- beetsplug/bpd/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/bpd/__init__.py b/beetsplug/bpd/__init__.py index 8a5cdee45..9c40d7b03 100644 --- a/beetsplug/bpd/__init__.py +++ b/beetsplug/bpd/__init__.py @@ -793,10 +793,10 @@ class Server(BaseServer): # Trying to list a track. raise BPDError(ERROR_ARG, 'this is not a directory') else: - for name, itemid in node.files.iteritems(): + for name, itemid in iter(sorted(node.files.items())): item = self.lib.get_item(itemid) yield self._item_info(item) - for name, _ in node.dirs.iteritems(): + for name, _ in iter(sorted(node.dirs.iteritems())): dirpath = self._path_join(path, name) if dirpath.startswith(u"/"): # Strip leading slash (libmpc rejects this). From 2a76a60794144b7aaaada6b96d4082bf20dadb82 Mon Sep 17 00:00:00 2001 From: Matteo Mecucci Date: Sun, 1 Apr 2012 22:41:38 +0200 Subject: [PATCH 3/4] Added --no-incremental option to beet import. --- beets/ui/commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 0895e6142..050fa9584 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -732,6 +732,8 @@ import_cmd.parser.add_option('-L', '--library', dest='library', action='store_true', help='retag items matching a query') import_cmd.parser.add_option('-i', '--incremental', dest='incremental', action='store_true', help='skip already-imported directories') +import_cmd.parser.add_option('--no-incremental', dest='incremental', + action='store_false', help='do not skip already-imported directories') def import_func(lib, config, opts, args): copy = opts.copy if opts.copy is not None else \ ui.config_val(config, 'beets', 'import_copy', From 594dca352906eb374b7c611b27e9cf103ef00759 Mon Sep 17 00:00:00 2001 From: Matteo Mecucci Date: Sun, 15 Apr 2012 19:10:14 +0200 Subject: [PATCH 4/4] Added the shortcut -I for --no-incremental. --- beets/ui/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 050fa9584..550bbce6d 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -732,7 +732,7 @@ import_cmd.parser.add_option('-L', '--library', dest='library', action='store_true', help='retag items matching a query') import_cmd.parser.add_option('-i', '--incremental', dest='incremental', action='store_true', help='skip already-imported directories') -import_cmd.parser.add_option('--no-incremental', dest='incremental', +import_cmd.parser.add_option('-I', '--no-incremental', dest='incremental', action='store_false', help='do not skip already-imported directories') def import_func(lib, config, opts, args): copy = opts.copy if opts.copy is not None else \