Enhance lastgenre plugin: add item.try_write() for write operations and improve documentation clarity

This commit is contained in:
Alok Saboo 2025-09-14 15:49:34 -04:00 committed by J0J0 Todos
parent a57ef2cb3b
commit 84986dc42d
2 changed files with 6 additions and 4 deletions

View file

@ -578,6 +578,8 @@ class LastGenrePlugin(plugins.BeetsPlugin):
if not pretend:
item.genre = item_genre
item.store()
if write and not pretend:
item.try_write()
lastgenre_cmd.func = lastgenre_func
return [lastgenre_cmd]

View file

@ -124,7 +124,7 @@ tags** and will only **fetch new genres for empty tags**. When ``force`` is
``yes`` the setting of the ``whitelist`` option (as documented in Usage_)
applies to any existing or newly fetched genres.
The follwing configurations are possible:
The following configurations are possible:
**Setup 1** (default)
@ -213,9 +213,9 @@ fetch genres for albums or items matching a certain query.
By default, ``beet lastgenre`` matches albums. To match individual tracks or
singletons, use the ``-A`` switch: ``beet lastgenre -A [QUERY]``.
To preview changes without modifying your library, use the ``-p``
(``--pretend``) flag. This shows which genres would be set but does not write
or store any changes.
- To preview the changes that would be made without applying them, use the
``-p`` (``--pretend``) flag. This shows which genres would be set but does
not write or store any changes.
To disable automatic genre fetching on import, set the ``auto`` config option to
false.