Fixes to the beets default tree and whitlist files I collected over the
years; Includes Tags last.fm returns quite often; Also the
chart.getTopTags API endpoint was checked to make sure the top 100
charts are included in beets default tree and whitelist.
I split out this refactor from #5744 to make the blacklist PR just a
little bit easier to read.
- Separate _load methods for whitelist and canonicalization tree file
loading.
- Add return type hints for those methods.
- Use `pathlib.Path()` instead of `normpath()`
- Additionally respect None value to fall back to built-in settings for
`canonical` and `whitelist` files (was only `""` before) - this code
exists for backwards compatibility (see
233f71a457),
and might be better sanity checked and vanish in the future... (a None
value is set eg. `canoncial:`) -> #5994
instead of codecs.open(), which most probably is a relict of beets' Python2/3 compatibility area.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
### Context
See https://github.com/beetbox/beets/pull/5916 where we've come across a
need to define common logic between `TrackInfo` and `AlbumInfo`.
### Changes
- Introduce generic `Info` base (extends `AttrDict`) used by `AlbumInfo`
/ `TrackInfo` to centralize shared attributes and initialisation logic.
- Sort keyword parameters in each constructor alphabetically and make
them explicit.
- Deduplicate and simplify shared `copy()` method using `copy.deepcopy`
- Improve type hints and documentation.
- Drop unused logging artifacts.
## Summary by Sourcery
Refactor metadata-handling classes by extracting common functionality
into a new Info base, updating AlbumInfo and TrackInfo to extend it with
explicit sorted parameters, unify their copy logic, improve type
annotations and docs, and drop obsolete logging code
New Features:
- Introduce a generic Info base class to centralize shared logic for
AlbumInfo and TrackInfo
Enhancements:
- Alphabetically sort and explicitly declare constructor keyword
parameters for consistency
- Unify and simplify the copy() implementation in AttrDict using
deepcopy
- Enhance type hints and documentation for metadata classes
Chores:
- Remove unused logging imports and artifacts
This PR includes documentation updates for the new `metadatasource`
plugin architecture, as requested by @snejus. The docs changes were
split out from the original implementation to keep things focused and
reviewable.
* Introduces comprehensive documentation for the new metadata plugin
system.
* Performs a general cleanup of the plugin-related developer
documentation for clarity and consistency.
* Splits and cleanup for quite some files in the dev docs