Conversation
…lter_tags' function.
Conflicts: beetsplug/lastgenre/__init__.py
- remove filter_tags() as genres should not be removed this soon while c14n has not been applied - group all filtering logic in the function _resolve_genres (formerly _strings_to_genre)
|
I think the build failed above because of teardown issues with the config. Each test just adds to the configuration in |
We don't have a test that reveals the incompatibility between c14n and lastfm weighings (which was the original issue met by @marlemion), because the tests are too high level : when we reach I added the |
If no option is set, valid genres should not be rejected. Which is an argument to have a wide default whitelist.
If no option is set, valid genres should not be rejected. Which is an argument to have a wide default whitelist.
|
Ok I realized that a restricted whitelist brings an obvious problem too, hence the commit above ^^ Sum-up of conclusions I've reached so far :
And regarding these facts, the problem I see with the plugin is that there is no way to turn the whitelist off (as opposed to c14n option), which makes it hard to handle the main use cases nicely. So let's imagine now that whitelist can be turned off and let's enumerate all the combinations :
tldr; sorry for the long post. Allowing whitelist to be off, enable us to fix issues 3, 4, and 5 listed at the top of this post, and make the current tests suite pass. Does that seem reasonable ? |
|
Sure! Allowing the whitelist to be disabled (e.g., Is there anything wrong with the very simple policy of applying canonicalization (if enabled) and then the whitelist (if enabled)? This would allow:
Also, I still think the weight filtering via |
By default it is disabled, setting the value to the empty string will use the built-in whitelist (same behaviour than c14n).
Give an empty string to obtain default whitelist, None for no whitelist or a stringlist for a custom one.
Rewrite tests now that empty whitelist is allowed.
Conflicts: test/test_lastgenre.py
|
Great; I've now merged @Kraymer's additions. @Kraymer, I also restored whitelisting by default. It seems like the default configuration should avoid tags like "seen live" and stuff that obviously isn't a genre. The tests ( The tests pass, I think, so maybe it's time to merge! We can of course add more later too. |
|
Oops, spoke too soon. Looks like we're still having some teardown issues causing problems with other tests. Nearly there, though. |
|
Now that the extensive whitelist is the default, what edit should be done to
Why not replace |
|
Sure! The booleans seem good to me. No reason why we can't also keep the older, weirder |
homogenise options setup using booleans, while keeping the empty string (synonym of ‘true’) for backward compatibility.
We now appropriately set up and tear down the fixture for the lastgenre tests. (This was causing unpredictable failures elsewhere before.)
As opposed to the strings "true" and "false".
|
I changed the options to use real YAML booleans ( And the tests all pass now! Think this is ready to merge, @Kraymer? |
We lost a call to |
|
Ah, good catch. Let's see if anyone complains. 😃 This was left over from the INI config file days, when whitespace was harder to control. Thanks for all the work on this! Merging. |
Tests for lastgenre (cleaned up)
This new PR supersedes #717. It contains only the refactoring and new tests. I also restored the min_weight option, which was lost in one of the refactoring commits.
Does this look mostly good, @Kraymer? Looks like we have one failing test, which I'm guessing was the whole goal of this exercise in the first place. 😃