Skip to content

Commit

Permalink
Final lastgenre docstring nitpicks
Browse files Browse the repository at this point in the history
and a tiny docs fix.
  • Loading branch information
JOJ0 committed Jan 23, 2025
1 parent 2708be2 commit 9d4653f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions beetsplug/lastgenre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ def _last_lookup(self, entity, method, *args):
whose arguments are given in the sequence `args`. The genre lookup
is cached based on the entity name and the arguments.
Before the lookup, each argument has some Unicode characters replaced
with rough ASCII equivalents in order to return better results from the
Last.fm database.
Before the lookup, each argument has the "-" Unicode character replaced
with its rough ASCII equivalents in order to return better results from
the Last.fm database.
"""
# Shortcut if we're missing metadata.
if any(not s for s in args):
Expand Down Expand Up @@ -322,21 +322,21 @@ def _get_genre(
) -> tuple[Union[str, None], ...]:
"""Get the final genre string for an Album or Item object.
`self.sources` specifies allowed genre sources (track, ablum, artist).
Together with several fallback scenarious, the following stages are run
through:
`self.sources` specifies allowed genre sources. Starting with the first
source in this tuple, the following stages run through until a genre is
found or no options are left:
- track (for Items only)
- album
- artist, albumartist or (for Various Artists albums) the "most
popular track genre" is used.
- artist, albumartist or "most popular track genre" (for VA-albums)
- original fallback
- fallback (configured value)
- configured fallback
- None
A `(genre, label)` pair is returned, where `label` is a string used for
logging that describes the result. For example, "keep + artist"
indicates that existing genres were combined with new last.fm genres,
while "artist" means only new last.fm genres are included.
logging. For example, "keep + artist, whitelist" indicates that existing
genres were combined with new last.fm genres and whitelist filtering was
applied, while "artist, any" means only new last.fm genres are included
and the whitelist feature was disabled.
"""
keep_genres = []
label = ""
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/lastgenre.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Add new last.fm genres when **empty**. Any present tags stay **untouched**.

**Combine** genres in present tags with new ones (be aware of that with an
enabled ``whitelist`` setting, of course some genres might get cleaned up. To
make sure any exisitng genres remain, set ``whitelist: no``).
make sure any existing genres remain, set ``whitelist: no``).

.. code-block:: yaml
Expand Down

0 comments on commit 9d4653f

Please sign in to comment.