Skip to content

Commit fc36716

Browse files
committed
lastgenre: Docs for genre ignorelist feature
1 parent 770682b commit fc36716

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

docs/plugins/lastgenre.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,58 @@ genres remain, set ``whitelist: no``).
160160
If ``force`` is disabled the ``keep_existing`` option is simply ignored
161161
(since ``force: no`` means ``not touching`` existing tags anyway).
162162

163+
Genre Ignorelist
164+
----------------
165+
166+
Last.fm tags are crowd-sourced, so they can be wrong — especially for artists
167+
whose names are shared with or confused with others. For example, a "Drum And
168+
Bass" artist named "Fracture" might incorrectly receive "Metal" tags. The
169+
ignorelist lets you reject specific genres globally or per-artist.
170+
171+
Another example for the ignorelist is to exclude genres that are technically
172+
correct but not useful to you. For example, you might want to exclude "Ska" for
173+
"Bob Marley", even though it is a valid genre for his music.
174+
175+
Filtering is done in two places: when fetching genres from Last.fm and when
176+
resolving to a final genre list (during canonicalization and whitelisting).
177+
178+
This means that existing genres are also filtered when ``force`` and
179+
``keep_existing`` options are enabled (or ``cleanup_existing`` is enabled with
180+
``force`` disabled).
181+
182+
To enable this feature, add an ``ignorelist`` section to your ``lastgenre``
183+
configuration:
184+
185+
.. code-block:: yaml
186+
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,
199+
regardless of artist. Patterns are matched against the full genre string, so a
200+
plain ``metal`` will not match ``heavy metal`` unless you write a regex like
201+
``.*metal``.
202+
203+
.. attention::
204+
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 a special YAML character (``[``, ``*``,
208+
or ``:``) or ends with ``:`` **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``).
214+
163215
Configuration
164216
-------------
165217

@@ -200,6 +252,9 @@ file. The available options are:
200252
internal whitelist, or ``no`` to consider all genres valid. Default: ``yes``.
201253
- **title_case**: Convert the new tags to TitleCase before saving. Default:
202254
``yes``.
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``.
203258

204259
Running Manually
205260
----------------

0 commit comments

Comments
 (0)