In the documentation of the Discogs plugin the ``index_tracks``
configuration option does not include the detail about the default
configuration that is applied when the option is not explicitly managed
in the configuration file.
If this PR is approved, the documentation will include that default ;)
Fixes#5930.
- Removed whitelist check immediately after last.fm fetch, which fixes
canonicalization - also unwanted genres need to remain at this point to
get successfully resolved "up" to parent genres
- Removed the `_filter_valid_genres()` helper method and went back to
_inline_ list comprehensions (readability)
- Ensured bug #5649 does not regress (the part were a resolve would kick
out everything and no fallback happens) by running a full
`_resolve_genre()` in each stage - if no genres remain in a stage the
next one is hit.
- Refactored `_get_genre` using a local helper method and returning
immediately on a satisfying outcome (Commits
d28738d92f
and
bb516a3a9c)
- Three new `test_get_genre` cases proof canonicalization works properly
Unrelated tiny fixes along the way:
- Clarified `--keep-existing` option docs
- Ensured list return type in `_last_lookup()`
To ensure proper fallback to the next stage, in each stage we do a full
combine/resolve/log.
Also we directly return if have satisfied results. As a bonus this
improves readability.
Some duplicate code on the label magic though...
- Remove "early whitelist check", since it breaks canonicalization of
actually unwanted genres (not whitelisted) resolving "up" to parent
genres.
- Remove the filter_valid_genres method entirely and get back to inline
list comprehensions. The caveat is that None genres are not catched
that way (see below, should be one of the last functions that finally
returns lists only)
- Along the way, fix _last_lookup's rearly return to empty list instead
of None.
- Test non-whitelisted genres resolving "up" in the tree.
- Test whitelisted original and whitelisted new genre resolving "up"
- Test non-whitelisted original genre resolving "up" (and deduplication
works)
This PR centralises plugin loading logic inside `beets.plugins` module.
- Removed intermediatery `_classes` variable by initialising plugins
immediately.
- Simplified listeners registration by defining listener variables in
the base
`BeetsPlugin` class, and making the `register_listener` method a
`@classmethod`.
- Simplified plugin test setup accordingly.
Centralise plugin loading in `beets.plugins` and refactor the plugin
loading system to be more straightforward and eliminate complex mocking
in tests. Replace the two-stage class collection and instantiation
process with direct instance creation and storage.
Add plugins.PluginImportError and adjust plugin import tests to only
complain about plugin import issues.
Add `py.typed` marker file to support PEP 561 typing
This PR adds a `py.typed` marker file to the package directory to
indicate that the package includes inline type hints and is PEP 561
compliant.