Make sure existing genres are ALWAYS looked at

first thing. Only if genres are existing and force is disabled we return
early!
This commit is contained in:
J0J0 Todos 2025-01-21 18:06:11 +01:00
parent 1219b43af4
commit 92e84a2b45

View file

@ -340,14 +340,14 @@ class LastGenrePlugin(plugins.BeetsPlugin):
"""
keep_genres = []
if not self.config["force"]:
genres = self._get_existing_genres(obj)
if genres and not self.config["force"]:
# Without force pre-populated tags are returned as-is.
if isinstance(obj, library.Item):
return obj.get("genre", with_album=False), "keep any, no-force"
return obj.get("genre"), "keep any, no-force"
if self.config["force"]:
genres = self._get_existing_genres(obj)
# Force doesn't keep any unless keep_existing is set.
# Whitelist validation is handled in _resolve_genres.
if self.config["keep_existing"]: