lastgenre: replace built-in genre list with improved hierarchy - #6654
lastgenre: replace built-in genre list with improved hierarchy#6654spaceage64 wants to merge 1 commit into
Conversation
52931f4 to
dcc1a46
Compare
|
@spaceage64 the tests are failing. @JOJ0 I'll leave this one to you! |
dcc1a46 to
b27c421
Compare
|
Thanks. Yes, I think the Proper Case is causing the tests to fail. In practice, it shouldn't cause issues though. I have made the list Proper Case so we no longer have to use very simplistic code to have beets do the Proper Case conversion. Please let me know if more input is required from my end. |
|
Hi @spaceage64 , yes this contribution is definitely appreciated. I see you put a lot, and I mean A LOT of effort in it 🤩 , that is really awesome and I think we can and should use/ship a lot of it with beets! But we can't simply accept it like it is! There are several issues I'm seeing and I have to warn you beforehand that it might be a lot of work to make this mergeable. If you are willing to work on it further and have some patience, together we might be able to put it to good use.
So maybe it is best we wait until the normalization feature is merged (I think we are close to merge already) and then let's brainstorm on how to proceed here. What do you think? |
|
Thanks @JOJ0, sounds fine to me. My list is very extensive, so it already kind of resolves the issue of matching aliases to a singular genre by just using many alternative terms, instead of using regex. I suppose regex can be used for some common cases, but in many others, aliases really are different from each other in ways that regex won't be able to capture. So for my personal use it actually works fine already this way, without the new regex logic. I think the best way to combine the two in the future is probably to remove any aliases that may also be matched using regex and keep the others. As for spelling, I'd really advise against just using simple lower to Proper Case conversion. It's way too simplistic to cover outliers, let alone non-English ones. Perhaps it may simplify the code, but it lowers the quality of the output. If there would be interest in using my hierarchy, it would already come with proper spelling by default, so I think it would be a waste to discard that and use inferior logic instead. Besides, even when only using lowercase in the code, my hierarchy is setup so that each Proper Case entry has directly under it a lower case variant used for matching. But as these are aliases, the Proper Case variant (i.e., the parent) should be returned instead. Perhaps I'm overlooking something, but it seems to me the logic already functions correctly. The only thing that would need changing, is getting rid of the additional Proper Case conversion the code currently includes. This would be the logic: lowercase any terms > regex lookup against aliases (all lowercase as well) > return Proper Case parent > done, no additional (potentially incorrect) conversion required. I agree the hierarchy is a product of my own personal ideas of what a proper structure should look like. I'd tried to include as much as possible:
Even for my own use case, I don't always want to use the genres suggested by the plugin, so I use a hook to offer me a range of options (all the lastgenre suggestions, but normalised against my hierarchy), or put in my own custom override. I think it would be cool if the plugin were to support such an option by default so people would have more control, but adjusting the code of the plugin is too difficult for me (as opposed to a simple hook shell script). So anyway, that's some more input from my side. I will await the regex merge and if more info would be required from me, please feel free to let me know. |
|
@spaceage64 This is great work and would be a vast improvement over our existing list. I will leave the final evaluation to @JOJ0 but I hope we can get this (or some version of this) in the master. |
|
In short, a first step would be: a total rework: "anything that is not an actual genre is a spelling correction" -> must move to aliases normalization (regex or simple match possible) Only! genres, in one normalized spelling should be in genres-tree.txt ! @arsaboo or @spaceage64 if you want to start with that, any help appreciated! |
Please open a feature suggestion for that and explain in more detail how that would work from a user perspective. Maybe even with outputs of how your current hook scripts looks like when in use. Thanks you! |
Here I give you an example of the work that needs to be done: This submitted section, needs the rework marked as comments: So after this work has been done, it would look like that (please keep 4-space-indentation in the file BTW) The additions to Again, I have to think about how we solve the spelling issue, we will find a way, but for now, simply put the correct spelling into the genres-tree.txt -> Please open a new issue for solving this idea properly @spaceage64 Last step: Ensure I know this is a lot of work and a lot of research and thinking but it is the only way. Sorry :-) The guide I linked in my previous post might help to keep in mind when to use what feature: |
We need to think on that matter! -> Separate issue please! canonicalization is not spelling correction! |
Description
The current genre list is alright but not very extensive, and also contains some oddities.
Replaces genres-tree.yaml and genres.txt with a significantly expanded and restructured genre hierarchy.
Pop → Asian Pop → K-Pop, notasian → east asian → k-pop.Electronic → Electronic Dance Music → House → Hard House → UK Hard House → Scouse House → Pumping House → HardbassClassical → Asian Classical → East Asian Classical → Korean Classical → Korean Court → Jeong-ak → GagokFolk → Traditional Folk → European Folk → Balkan Folk → Greek Folk → Cretan Folk → RizitikaSources used:
Fixes #6628
To Do
I don't know if my PR is even appreciated, but a lack of extensive genre maintenance was bothering me personally. The default list seems to be based on some very old extraction of Wikipedia and isn't necessarily of high quality. So I put a lot of effort into building this for personal use and I thought I'd at least offer to share. Please let me know if anything more would be required from my side.