| 1 |
Zero Plugin |
| 2 |
=========== |
| 3 |
|
| 4 |
The ``zero`` plugin allows you to null fields in files' metadata tags. Fields |
| 5 |
can be nulled unconditionally or conditioned on a pattern match. For example, |
| 6 |
the plugin can strip useless comments like "ripped by MyGreatRipper." |
| 7 |
|
| 8 |
The plugin can work in one of two modes: |
| 9 |
|
| 10 |
- ``fields``: A blacklist, where you choose the tags you want to remove (used by |
| 11 |
default). |
| 12 |
- ``keep_fields``: A whitelist, where you instead specify the tags you want to |
| 13 |
keep. |
| 14 |
|
| 15 |
To use the ``zero`` plugin, enable the plugin in your configuration (see |
| 16 |
:ref:`using-plugins`). |
| 17 |
|
| 18 |
Configuration |
| 19 |
------------- |
| 20 |
|
| 21 |
Make a ``zero:`` section in your configuration file. You can specify the fields |
| 22 |
to nullify and the conditions for nullifying them: |
| 23 |
|
| 24 |
- Set ``auto`` to ``yes`` to null fields automatically on import. Default: |
| 25 |
``yes``. |
| 26 |
- Set ``fields`` to a whitespace-separated list of fields to remove. You can get |
| 27 |
the list of all available fields by running ``beet fields``. In addition, the |
| 28 |
``images`` field allows you to remove any images embedded in the media file. |
| 29 |
- Set ``keep_fields`` to *invert* the logic of the plugin. Only these fields |
| 30 |
will be kept; other fields will be removed. Remember to set only ``fields`` or |
| 31 |
``keep_fields``---not both! |
| 32 |
- To conditionally filter a field, use ``field: [regexp, regexp]`` to specify |
| 33 |
regular expressions. |
| 34 |
- Set ``omit_single_disc`` to ``True`` to omit writing the ``disc`` number and |
| 35 |
the ``disctotal`` number for albums with a single disc (``disctotal == 1``). |
| 36 |
- By default this plugin only affects files' tags; the beets database is left |
| 37 |
unchanged. To update the tags in the database, set the ``update_database`` |
| 38 |
option to true. |
| 39 |
|
| 40 |
For example: |
| 41 |
|
| 42 |
:: |
| 43 |
|
| 44 |
zero: |
| 45 |
fields: month day genre genres comments |
| 46 |
comments: [EAC, LAME, from.+collection, 'ripped by'] |
| 47 |
genres: [rnb, 'power metal'] |
| 48 |
update_database: true |
| 49 |
|
| 50 |
If a custom pattern is not defined for a given field, the field will be nulled |
| 51 |
unconditionally. |
| 52 |
|
| 53 |
Note that the plugin currently does not zero fields when importing "as-is". |
| 54 |
|
| 55 |
Manually Triggering Zero |
| 56 |
------------------------ |
| 57 |
|
| 58 |
You can also type ``beet zero [QUERY]`` to manually invoke the plugin on music |
| 59 |
in your library. |
| 60 |
|
| 61 |
Preserving Album Art |
| 62 |
-------------------- |
| 63 |
|
| 64 |
If you use the ``keep_fields`` option, the plugin will remove embedded album art |
| 65 |
from files' tags unless you tell it not to. To keep the album art, include the |
| 66 |
special field ``images`` in the list. For example: |
| 67 |
|
| 68 |
:: |
| 69 |
|
| 70 |
zero: |
| 71 |
keep_fields: title artist album year track genre genres images |