lastgenre: Genre spelling normalization (aliases)#6466
Open
JOJ0 wants to merge 4 commits intolastgenre_forbiddenfrom
Open
lastgenre: Genre spelling normalization (aliases)#6466JOJ0 wants to merge 4 commits intolastgenre_forbiddenfrom
JOJ0 wants to merge 4 commits intolastgenre_forbiddenfrom
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## lastgenre_forbidden #6466 +/- ##
=======================================================
+ Coverage 69.91% 69.96% +0.04%
=======================================================
Files 146 146
Lines 18575 18642 +67
Branches 3027 3052 +25
=======================================================
+ Hits 12987 13042 +55
Misses 4957 4957
- Partials 631 643 +12
🚀 New features to boost your workflow:
|
20b2d88 to
90064fa
Compare
66a7d98 to
1785dab
Compare
1785dab to
c5a14d3
Compare
062bb80 to
7ebfd09
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. |
Member
Author
JOJ0
commented
Mar 29, 2026
Comment on lines
+252
to
+268
| Choosing the Right Tool | ||
| ----------------------- | ||
|
|
||
| With multiple ways to filter and map genres, here is a quick guide on when to | ||
| use what: | ||
|
|
||
| - **Aliases**: Use these first to fix spelling variants and abbreviations (e.g., | ||
| ``dnb`` → ``drum and bass``). | ||
| - **Ignorelist**: Use this for error correction when Last.fm results are not | ||
| accurate, or for precise per-artist or global exclusions (e.g., rejecting | ||
| ``Metal`` for specific electronic artists). | ||
| - **Canonicalization**: Use this to automatically map specific sub-genres to | ||
| broader categories (e.g., ``Grindcore`` → ``Metal``). | ||
| - **Whitelist**: Use this to finally limit your library to a predefined set of | ||
| genres. When combined with canonicalization, the plugin will try to map a | ||
| sub-genre to its closest whitelisted parent. Anything else is dropped. | ||
|
|
Member
Author
There was a problem hiding this comment.
Reviewers: This new chapter is a good starting point for reviewing and might help thinking through where and when things should happen in the plugin and why multiple filtering features make sense for this plugin!
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
This PR introduces a regex-based normalization (alias) system to unify variant genre tags and improves the plugin's documentation.
The normalization feature uses an ordered list of regular expression aliases to map variant spellings or synonyms to a single canonical name. The mapping keys act as
re.Match.expand()templates, supporting\g<N>back-references to regex capture groups:normalize_genrebeforeis_ignoredin both theLastFmClient(for clean fetching/caching) and the core_resolve_genresloop (for uniform processing of existing file tags).