Commit graph

12907 commits

Author SHA1 Message Date
Sebastian Mohr
8de2a142ce Fixed issue with mpdstats test and removed unregister_all function
as it introduces issues.
2025-09-17 20:55:02 +02:00
Sebastian Mohr
fba8e95228 Fixed typing issues. 2025-09-17 19:26:11 +02:00
Sebastian Mohr
21d07b41ff Renamed PluginTestCase to PluginUnitTestCase 2025-09-17 19:18:48 +02:00
Sebastian Mohr
ad719d8668 Refactored most plugin tests to use pytest instead of unitest.
Also simplified test wherever possible.
2025-09-17 18:58:03 +02:00
neofright
394d78de97
Replace flowery language (#6002)
Simplify wording by replacing flowery or pretentious terms throughout the project. 

A bouquet refers to trees or flowers. The etymology is pretty clear on
the Latin root via French.

Co-authored-by: Sebastian Mohr <sebastian@mohrenclan.de>
2025-09-15 09:02:22 +00:00
JOJ0
e837598e79 Increment version to 2.4.0 2025-09-13 16:47:21 +00:00
Šarūnas Nejus
2b4758d440
Improve default pretty diff colors (#5949)
- Switch default `text_diff_added` color from bold **red** to bold
**green**; unify all diff/case comparisons to use `text_diff_added` and
`text_diff_removed` colors consistently.
- Simplify color handling and setup: introduce cached color config
(validation + legacy normalization), consolidate regexes
- Remove unused colors names
- Update `ui` configuration docs.

### `beet write -p year:2000..2005`

#### Before
<img width="1261" height="460" alt="image"
src="https://github.com/user-attachments/assets/70207350-6d9a-48d8-a314-457ac07c5ad1"
/>

#### After
<img width="1257" height="536" alt="image"
src="https://github.com/user-attachments/assets/efcf3453-016a-490f-84ab-dedfb2aca97b"
/>

### `beet move -p albumtype:broadcast`

#### Before
<img width="1103" height="505" alt="image"
src="https://github.com/user-attachments/assets/9e76c5d6-d878-4535-9da3-a949e6c0830c"
/>

#### After
<img width="1134" height="508" alt="image"
src="https://github.com/user-attachments/assets/3dc03988-8011-4072-8840-6f0a0d12350f"
/>

## Summary by Sourcery

Improve default diff colors from red to green and streamline color
handling by refactoring ANSI code management, removing legacy logic, and
unifying diff highlighting. Also extract a cached changed_prefix
property and update UI config documentation.

Enhancements:
- Introduce cached get_color_config and consolidate ANSI escape regex
patterns to simplify color configuration parsing
- Refactor diff highlighting to consistently use text_diff_added and
text_diff_removed and simplify _colordiff implementation
- Add ChangeRepresentation.changed_prefix cached property for consistent
‘not equal’ prefix formatting

Documentation:
- Update UI configuration documentation to reflect new default colors
and removed settings

Chores:
- Remove unused color names and legacy normalization code
2025-09-13 12:57:13 +01:00
Šarūnas Nejus
30093c517e
Define color regex patterns once 2025-09-13 11:24:57 +01:00
Šarūnas Nejus
841c49d494
Update ui configuration docs 2025-09-13 11:24:57 +01:00
Šarūnas Nejus
f816f894d3
Use default red/green for case differences 2025-09-13 11:24:56 +01:00
Šarūnas Nejus
f8c2008f29
Dedupe "changed" colorize calls 2025-09-13 11:24:56 +01:00
Šarūnas Nejus
04380676e1
Slightly simplify colors setup
This replaces the funky color setup based on a global `COLORS` variable
with a cached function `get_color_config`.
2025-09-13 11:24:56 +01:00
Šarūnas Nejus
0818505334
Fix diff coloring for added and removed text in field diffs
- Update default `text_diff_added` value: red -> green
- Use `text_diff_removed` and `text_diff_added` instead of `text_error`
  in UI
2025-09-13 11:24:55 +01:00
Šarūnas Nejus
e7c12988bc
Remove unused colors 2025-09-13 11:24:44 +01:00
J0J0 Todos
160d4074b2
lastgenre: Some whitelist and genres-tree updates (#5977)
Addresses some fixes and additions mentioned here #5915 and some I
collected myself over the years.

Of course genres and sub-genres classifications always are rather
opinionated, but I consider them useful for others too. Critical
feedback is welcome.
2025-09-13 12:14:37 +02:00
J0J0 Todos
d24a85121b Changelog for #5977 lastgenre whitelist/tree 2025-09-13 09:30:20 +02:00
J0J0 Todos
e59521e375 lastgenre: tree/whitelist: Remove experimental
experimental, even though a tag last.fm very often returns (in top 20
tag charts!), it is too broad of a term to be pinned downed with any
particular genre, thus can't really be used for canonicalization.
2025-09-13 09:29:43 +02:00
J0J0 Todos
a98ba061e8 lastgenre: tree/whitelist: UK/Breakbeat Hardcore
Also changes decided during PR discussions and more research.
2025-09-13 09:29:43 +02:00
J0J0 Todos
9f442dcf75 lastgenre: tree/whitelist: Contributor feedback
that came up in the pull request comments and other discussions.
2025-09-13 09:29:43 +02:00
J0J0 Todos
4949f44e82 lastgenre: tree/whitlist: Jojo's essential fixes
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.
2025-09-13 09:29:43 +02:00
J0J0 Todos
3faa1af858
lastgenre: Move file loading to helpers (#5979)
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
2025-09-10 08:30:53 +02:00
J0J0 Todos
7a5cfa8f46 lastgerne: Update wl/tree load methods docstrings 2025-09-10 07:36:47 +02:00
J0J0 Todos
d2caed3971 lastgenre: Also log which whitelist file is loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
6601cbf8c0 lastgenre: canonical/whitelist setting None load default files 2025-09-10 07:36:47 +02:00
J0J0 Todos
6bc30eaf18 lastgenre: Add docstrings to file load methods 2025-09-10 07:36:47 +02:00
J0J0 Todos
6da72beeb0 lastgenre: Add expanduser to whitelist/tree load 2025-09-10 07:36:47 +02:00
J0J0 Todos
81d342b79f lastgenre: Simplify default tree loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
c54a54682f lastgenre: Use pathlib and simplify whitelist load
- Read the whole file using Path().read_text()
- Strip whitespace and lower() transform

Drawbacks:

- Normalization gets lost (normpath did that)
2025-09-10 07:36:47 +02:00
J0J0 Todos
fbd90b0507 lastgenre: Use pathlib for opening tree file
instead of syspath(normpath())

Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-10 07:36:47 +02:00
J0J0 Todos
0cdb1224b9 lastgenre: Fix c14n load log msg format 2025-09-10 07:36:47 +02:00
J0J0 Todos
856bde1efb Changelog for #5979 lastgenre move file loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
bbde63d87e lastgenre: Accept AI suggested use open() for tree file
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>
2025-09-10 07:36:47 +02:00
J0J0 Todos
a98fa054fe lastgenre: Fix failing CI tests by using syspath
when loading c14n file.
2025-09-10 07:36:47 +02:00
J0J0 Todos
5ff88b46cf lastgenre: Fix another mypy error in c14n load
(that was only happening in CI and not by local poe check-types)
2025-09-10 07:36:47 +02:00
J0J0 Todos
8ae29e42bf lastgenre: Fix mypy errors in file load methods 2025-09-10 07:36:47 +02:00
J0J0 Todos
6ed17912b4 lastgenre: Fix _load_whitelist return type bytes 2025-09-10 07:36:47 +02:00
J0J0 Todos
bf903fc27d lastgenre: Move file loading to helpers
and add return types.
2025-09-10 07:36:47 +02:00
Šarūnas Nejus
f24beca085
Create common info class (#5963)
### 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
2025-09-08 14:34:18 +01:00
Šarūnas Nejus
19c43c9796
hooks: Sort Info classes parameters and attr assignments alphabetically 2025-09-07 21:08:42 +01:00
Šarūnas Nejus
150db9c0d9
hooks: Update Info classes documentation 2025-09-07 21:08:42 +01:00
Šarūnas Nejus
e74646b8ae
hooks: Tidy up types and unused attributes 2025-09-07 21:08:42 +01:00
Šarūnas Nejus
60773d66b0
hooks: abstract common attrs info Info class 2025-09-07 21:08:42 +01:00
Šarūnas Nejus
e8d2c28e94
hooks: Generalise AlbumInfo and TrackInfo into Info 2025-09-07 21:08:41 +01:00
Šarūnas Nejus
7340f150e0
Add CODEOWNERS file (#5961)
Add CODEOWNERS file assigning all files (*) to
[`@beetbox/maintainers`](https://github.com/orgs/beetbox/teams/maintainers)
so that team is auto-requested for reviews.
2025-09-06 17:52:58 +01:00
Šarūnas Nejus
ecc4a72f2c
Add a note about ownership 2025-09-06 17:43:16 +01:00
Šarūnas Nejus
37ae23faf5
Add CODEOWNERS file to assign the entire repo to @maintainers 2025-09-06 17:43:15 +01:00
Sebastian Mohr
8fc38ad781
Removed data source from listenbrainz as it is not an metadata source plugin. (#5987)
closes #5975
2025-09-06 16:25:39 +02:00
Sebastian Mohr
e51de5de91 Removed data source as listenbrainz is not an metadata source plugin.
closes #5975
2025-09-04 17:41:12 +02:00
Sebastian Mohr
55667fa1e8
Metadatasource cleanup docs (#5861)
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
2025-09-04 17:11:35 +02:00
Sebastian Mohr
123075d511 Updated git blame hashes yet again :) 2025-09-04 16:07:25 +02:00