Skip to content

Commit c5a14d3

Browse files
committed
Update docs for yaml refactor
1 parent 9ac3de4 commit c5a14d3

1 file changed

Lines changed: 27 additions & 19 deletions

File tree

docs/plugins/lastgenre.rst

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -179,30 +179,38 @@ This means that existing genres are also filtered when the ``force`` and
179179
``keep_existing`` options are enabled (or ``cleanup_existing`` is enabled with
180180
``force: no``).
181181

182-
A possible ``ignorelist`` file would look like this:
182+
To enable this feature, add an ``ignorelist`` section to your ``lastgenre``
183+
configuration:
183184

184-
.. code-block:: text
185-
186-
fracture:
187-
^(heavy|black|power|death)?\s?(metal|rock)$|\w+-metal\d*$
188-
progressive metal
189-
bob marley:
190-
ska
191-
*:
192-
electronic
185+
.. code-block:: yaml
193186
194-
A combination of regex patterns and plain genre names is possible. The ``*`` key
195-
applies globally to all artists — use it to block genres you never want,
187+
lastgenre:
188+
ignorelist:
189+
fracture:
190+
- ^(heavy|black|power|death)?\s?(metal|rock)$|\w+-metal\d*$
191+
- progressive metal
192+
bob marley:
193+
- ska
194+
'*':
195+
- electronic
196+
197+
A combination of regex patterns and plain genre names is possible. The ``'*'``
198+
key applies globally to all artists — use it to block genres you never want,
196199
regardless of artist. Patterns are matched against the full genre string, so a
197200
plain ``metal`` will not match ``heavy metal`` unless you write a regex like
198201
``.*metal.*``.
199202

200-
Set the ``ignorelist`` option to the path of a file containing such entries to
201-
enable this feature.
202-
203203
.. attention::
204204

205-
Do not use single or double quotes around the genre names or regex patterns.
205+
- The global key ``'*'`` **must** be surrounded by single quotes so that
206+
YAML does not interpret it as an anchor.
207+
- Any regex pattern that starts with special YAML characters (especially
208+
``[`` or ``*``) **must** be surrounded by quotes.
209+
- Prefer **single quotes** (``'...'``) when quoting is necessary, as they
210+
treat backslashes literally (no double-escaping required).
211+
- Because the ignorelist uses plain YAML, you do **not** need to
212+
double-escape backslashes in unquoted or single-quoted strings (e.g., use
213+
``\w``, not ``\\w``).
206214

207215
Configuration
208216
-------------
@@ -244,9 +252,9 @@ file. The available options are:
244252
internal whitelist, or ``no`` to consider all genres valid. Default: ``yes``.
245253
- **title_case**: Convert the new tags to TitleCase before saving. Default:
246254
``yes``.
247-
- **ignorelist**: The path to a file that contains genres to exclude from being
248-
set as genres for specific artists. See `Genre Ignorelist`_ for more details.
249-
Default: ``no``.
255+
- **ignorelist**: A mapping of artist names (or the global ``'*'`` key) to lists
256+
of genres to exclude. See `Genre Ignorelist`_ for more details. Default:
257+
``no``.
250258

251259
Running Manually
252260
----------------

0 commit comments

Comments
 (0)