lastgenre: Fix track-level handling and streamline logging#5582
Merged
Conversation
When `lastgenre.source: track` is configured, - `lastgenre -a` _should not_ fall back to the album level genre (by making use of the with_album=False kwarg of the Libary's get method). - `lastgenre -a`, when finally storing the genres of _an album_, should _not_ also write the tracks genres (by making use of the inherit=False kwarg of the Album's store method.
It was rather confusing that the lastgenre plugin, when handling singletons, sometimes showed that it applied genres from last.fm and sometimes didn't (it did only in debug log). This streamlines the behaviour: - Change debug to info log. - Streamline wording. - Display details about the track.
is configured.
- Printing out album/item in default format could lead to unreadable clutter depending on the user's configured formats. - The album's name and the individual tracks' title should be just sufficient to provide context as well readability. - Log like this while importing as well as in standalone runs.
|
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. |
8 tasks
Member
Author
|
Ready for final testing if you find the time @arsaboo. Also ready for a final code review @snejus or @Serene-Arc, if you have a minute. I think it's pretty straightforward. Testing like this: and |
Contributor
|
Tested and here's my output: $ beet lastgenre -A
lastgenre: genre for track Die With A Smile (None):
arsaboo@ubuntuvm2:~$ beet lastgenre -A -s track
lastgenre: genre for track Die With A Smile (None):I guess this PR is working. The tracks not found is probably a separate issue (about Lastfm search that needs to be improved) |
Member
Author
|
This is best tested with an (not too rare) album with many tracks or even better with a various artist compilation. |
Serene-Arc
approved these changes
Jan 9, 2025
Contributor
Serene-Arc
left a comment
There was a problem hiding this comment.
lgtm, merge when ready
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix
lastgenre -Ain combination with config optionsource: track(Tracks inherited the album's genre even when this option was set)Fix log-level and message wording being slightly different for
source:track, album, artist genreNote: This was split out from PR #4982
To Do
keep_existing#4982 will include a better pytest-based test for the_get_genrefunction)