lastgenre: Album stage fall back to multi-valued albumartists - #6893
lastgenre: Album stage fall back to multi-valued albumartists#6893JOJ0 wants to merge 3 commits into
Conversation
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
58675e5 to
054d241
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## lastgenre_refactor_get_genre #6893 +/- ##
=============================================================
Coverage 75.67% 75.68%
=============================================================
Files 163 163
Lines 21418 21430 +12
Branches 3385 3388 +3
=============================================================
+ Hits 16209 16219 +10
- Misses 4410 4411 +1
- Partials 799 800 +1
🚀 New features to boost your workflow:
|
054d241 to
08557bd
Compare
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
251def4 to
e8e5265
Compare
Try and concatinate genres of each member of albumartists in the multi-valued field if no genre for the main albumartist could be found.
e8e5265 to
95086dc
Compare
There was a problem hiding this comment.
Pull request overview
PR make lastgenre album stage smarter for multi-artist albums. When Last.fm give no album tags for main albumartist, plugin now try album lookup for each value in multi-valued albumartists, then still fall through to artist stage if nothing found.
Changes:
- Add
_try_resolve_album_stagehelper to hold album-stage logic and multi-valuedalbumartistsfallback. - Add focused unit test that exercises per-albumartist album lookup fallback.
- Document new multi-artist album behavior in
lastgenredocs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
beetsplug/lastgenre/__init__.py |
Add album-stage helper that falls back to per-albumartists album lookups when primary album lookup empty. |
test/plugins/test_lastgenre.py |
Add direct test for _try_resolve_album_stage fallback behavior. |
docs/plugins/lastgenre.rst |
Document album-stage fallback to multi-valued albumartists before artist source. |
| resolved := self._try_resolve_stage( | ||
| "multi-valued albumartist album", | ||
| keep_genres, | ||
| multi_album_genres, | ||
| artist=None, | ||
| ) |
| assert plugin._try_resolve_album_stage(item, []) == ( | ||
| ["Rock"], | ||
| "multi-valued albumartist album, any", | ||
| ) |
Description
Fixes: #6238
If last.fm returns no album genres for
albumartist, fall back to querying the album against each artist inalbumartists(falling through to the artist stage if that also yields nothing.)The album stage reasoning is now slightly more complex and was moved to its own helper method.
Note: Requires #6474
To Do