mirror of
https://github.com/beetbox/beets.git
synced 2026-02-22 23:33:50 +01:00
changelog and tweaks for #275
I've removed the -p option. The command now always shows plugin-provided template fields if any are available. We also avoid printing out blank lines for plugins that don't provide fields.
This commit is contained in:
parent
22044eacac
commit
916ceb4b15
3 changed files with 16 additions and 15 deletions
|
|
@ -91,20 +91,20 @@ def _showdiff(field, oldval, newval):
|
|||
|
||||
fields_cmd = ui.Subcommand('fields',
|
||||
help='show fields available for queries and format strings')
|
||||
fields_cmd.parser.add_option('-p', '--plugins', dest='plugins',
|
||||
action='store_true',
|
||||
help='show available plugin fields as well')
|
||||
|
||||
def fields_func(lib, opts, args):
|
||||
print("Available item fields:")
|
||||
print("Item fields:")
|
||||
print(" " + "\n ".join([key for key in library.ITEM_KEYS]))
|
||||
print("\nAvailable album fields:")
|
||||
|
||||
print("\nAlbum fields:")
|
||||
print(" " + "\n ".join([key for key in library.ALBUM_KEYS]))
|
||||
if opts.plugins:
|
||||
print("\nAvailable plugin fields:")
|
||||
for plugin in plugins.find_plugins():
|
||||
fields = plugin.template_fields.iteritems()
|
||||
print(" " + "\n ".join([key for (key, value) in fields]))
|
||||
|
||||
plugin_fields = []
|
||||
for plugin in plugins.find_plugins():
|
||||
plugin_fields += plugin.template_fields.keys()
|
||||
if plugin_fields:
|
||||
print("\nTemplate fields from plugins:")
|
||||
print(" " + "\n ".join(plugin_fields))
|
||||
|
||||
fields_cmd.func = fields_func
|
||||
default_commands.append(fields_cmd)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ Changelog
|
|||
to some fixes in dealing with special characters.
|
||||
* Plugin-provided template fields now work for both Albums and Items. Thanks
|
||||
to Pedro Silva.
|
||||
* The :ref:`fields-cmd` command shows template fields provided by plugins.
|
||||
Thanks again to Pedro Silva.
|
||||
|
||||
1.1.0 (April 29, 203)
|
||||
---------------------
|
||||
|
|
|
|||
|
|
@ -246,17 +246,16 @@ Show some statistics on your entire library (if you don't provide a
|
|||
The ``-e`` (``--exact``) option makes the calculation of total file size more
|
||||
accurate but slower.
|
||||
|
||||
.. _fields-cmd:
|
||||
|
||||
fields
|
||||
``````
|
||||
::
|
||||
|
||||
beet fields [-p]
|
||||
beet fields
|
||||
|
||||
Show the item and album metadata fields available for use in :doc:`query` and
|
||||
:doc:`pathformat`.
|
||||
|
||||
The ``-p`` (``--plugins``) option shows available plugin fields in
|
||||
addition to the standard ones.
|
||||
:doc:`pathformat`. Includes any template fields provided by plugins.
|
||||
|
||||
Global Flags
|
||||
------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue