Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lastgenre: New config option
keep_existing
(#4982)
## New config option `keep_existing` (#4982) - Fix the behavior of the`force` option. Previously disabling the option had "incomplete" behaviour: - If content was found, a whitelist check was issued and if valid the plugin exited early and logged ("keep"). - This whitelist check was not aware of multiple genres (separated typically by a string like `, `), thus it failed erased all existing genres and overwrote with new ones. _**This didn't feel like a typical behaviour of a `force` option, which this PR tries to improve as follows...**_ - String-separated multi-genres are now compiled into a list and depending on the `whitelist` option are kept and enriched with freshly fetched last.fm genres. - If force is off, pre-populated tags are not touched. - A lot of refactoring was done, some absolutely required, some as a preparation for future work on the plugin. - The main processing function `_get_genre` was massively overhauled and got a new `pytest.mark.parametrize` test which includes much more test cases.
- Loading branch information