Skip to content

Commit 051e8e6

Browse files
committed
Fix orig fallback stage, use helper
1 parent 484f2bf commit 051e8e6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

beetsplug/lastgenre/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,7 @@ def _try_resolve_stage(
553553

554554
# Nothing found, leave original if configured and valid.
555555
if genres and self.config["keep_existing"].get():
556-
if isinstance(obj, library.Item):
557-
# For track items, use track artist (important for compilations).
558-
artist = getattr(obj, "artist", None)
559-
else:
560-
# For albums, prefer albumartist, fall back to artist.
561-
artist = getattr(obj, "albumartist", None) or getattr(
562-
obj, "artist", None
563-
)
556+
artist = self._artist_for_filter(obj)
564557
if valid_genres := self._filter_valid(genres, artist=artist):
565558
return valid_genres, "original fallback"
566559
# If the original genre doesn't match a whitelisted genre, check

0 commit comments

Comments
 (0)