Commit graph

13267 commits

Author SHA1 Message Date
Ember Light
022d7625d2 Add changelog 2025-10-16 18:49:39 +02:00
Ember Light
6d2d663d3e Add documentation 2025-10-16 18:49:32 +02:00
Ember Light
f275835cd3 Add test 2025-10-16 18:49:24 +02:00
Ember Light
472aa12767 Add main functionality 2025-10-16 18:49:14 +02:00
Šarūnas Nejus
becb073aac
lastgenre: Refactor genre applying and pretend mode (#6021)
- Refactor and reduce the code required to log and apply the genre.
- Make the output a bit more user-friendly:
    - Use str(obj) to log the object using the user configured format_item / format_album values
    - Use ui.show_model_changes to show the change in genre with colors
2025-10-15 22:50:46 +01:00
Šarūnas Nejus
88011a7c65
Show genre change using show_model_changes 2025-10-15 11:14:26 +01:00
Šarūnas Nejus
0aac7315c3
lastgenre: refactor genre processing with singledispatch
Replace the log_and_pretend decorator with a more robust implementation
using singledispatchmethod. This simplifies the genre application logic
by consolidating logging and processing into dedicated methods.

Key changes:
- Remove log_and_pretend decorator in favor of explicit dispatch
- Add _fetch_and_log_genre method to centralize genre fetching and logging
- Log user-configured full object representation instead of specific
attributes
- Introduce _process singledispatchmethod with type-specific handlers
- Use LibModel type hint for broader compatibility
- Simplify command handler by removing duplicate album/item logic
- Replace manual genre application with try_sync for consistency
2025-10-15 09:55:52 +01:00
Šarūnas Nejus
ee289844ed
Add _process_album and _process_item methods 2025-10-15 09:55:52 +01:00
Šarūnas Nejus
c2d5c1f17c
Update test 2025-10-15 09:55:51 +01:00
J0J0 Todos
65f5dd579b
Add pytest-mock to poetry test dependencies group 2025-10-15 09:55:33 +01:00
J0J0 Todos
654c14490e
lastgenre: Refactor test_pretend to pytest 2025-10-15 09:54:41 +01:00
J0J0 Todos
d617e67199
lastgenre: Fix test_pretend_option
only one arg is passed to the info log anymore.
2025-10-15 09:52:32 +01:00
J0J0 Todos
1acec39525
lastgenre: Use apply methods during import 2025-10-15 09:52:32 +01:00
J0J0 Todos
8613b3573c
lastgenre: Refactor final genre apply
- Move item and genre apply to separate helper functions. Have one
  function for each to not overcomplicate implementation!
- Use a decorator log_and_pretend that logs and does the right thing
  depending on wheter --pretend was passed or not.
- Sets --force (internally) automatically if --pretend is given (this is
  a behavirol change needing discussion)
2025-10-15 09:52:32 +01:00
henry
0bf248d355
Add custom feat words for ftintitle (#6090)
## Description

For non English tracks (Swedish in my case) feat. words might be
something that ftintitle doesn't pick up.
Eg. for the song `Promoe med Afasi - Inflation`
[https://musicbrainz.org/recording/8e236347-61d6-4e11-9980-52f4cc6b905f](https://musicbrainz.org/recording/8e236347-61d6-4e11-9980-52f4cc6b905f)
the word `med` is `feat.` in Swedish.
With this PR you can add what ever word you wish to match as feat. so it
should cover any kind of language.

The config.yaml could look like this:
ftintitle:
  custom_feat_words: ["med"]

## To Do

<!--
- If you believe one of below checkpoints is not required for the change
you
are submitting, cross it out and check the box nonetheless to let us
know.
  For example: - [x] ~Changelog~
- Regarding the changelog, often it makes sense to add your entry only
once
reviewing is finished. That way you might prevent conflicts from other
PR's in
that file, as well as keep the chance high your description fits with
the
  latest revision of your feature/fix.
- Regarding documentation, bugfixes often don't require additions to the
docs.
- Please remove the descriptive sentences in braces from the enumeration
below,
  which helps to unclutter your PR description.
-->

- [x] Documentation. (If you've added a new command-line flag, for
example, find the appropriate page under `docs/` to describe it.)
- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
- [x] Tests. (Very much encouraged but not strictly required.)
2025-10-14 20:38:02 -07:00
snejus
c1877b7cf5 Increment version to 2.5.1 2025-10-14 22:51:15 +00:00
Šarūnas Nejus
61cbc39c4a
Revert "Add git commit suffix to __version__ for development installs (#5967)" 2025-10-14 23:39:27 +01:00
Šarūnas Nejus
efe1a67e84
Revert "Fix dynamic versioning plugin not correctly installed in workflow (#6094)"
This reverts commit dc9b498ee8, reversing
changes made to 77842b72d7.
2025-10-14 23:38:01 +01:00
Sebastian Mohr
af022683fe
Legacy plugin copy not copying properties. (#6101)
The recently introduces `data_source_mismatch_penalty` property in the MetadataPlugin
class was not copied in the backwards compatibility layer. This PR
introduces a fixes this such that `cached_properties` are copied to
legacy metadata plugins.

This also includes a test for the expected behavior.

See also [beetcamp
issue](https://github.com/snejus/beetcamp/issues/85#issuecomment-3399273892).
2025-10-14 20:41:31 +02:00
Sebastian Mohr
391ca4ca26 Yet some more simplification. 2025-10-14 20:25:07 +02:00
Sebastian Mohr
365ff6b030 Added test additions 2025-10-14 19:55:50 +02:00
Sebastian Mohr
f339d8a4d3 slight simplification. 2025-10-14 19:55:50 +02:00
Sebastian Mohr
670c300625 Fixed issue with legacy plugin copy not copying properties. Also
added test for it
2025-10-14 19:55:50 +02:00
Šarūnas Nejus
ecea47320c
Load the last plugin class found in the namespace (#6100)
- Modified `_get_plugin` function to use `reversed()` when iterating
through `namespace.__dict__.values()`
- This ensures that we load _the last_ plugin class found in the
namespace.

Fixes #6093
2025-10-14 17:05:29 +01:00
Šarūnas Nejus
f33c030ebb
Convert replacements and Include URLs for :class: refs in release notes 2025-10-14 16:54:52 +01:00
Šarūnas Nejus
fbc12a358c
Add changelog note 2025-10-14 16:54:52 +01:00
Šarūnas Nejus
13f40de5bb
Make _verify_config method private to remove it from the docs 2025-10-14 16:21:33 +01:00
Šarūnas Nejus
7fa9a30b89
Add note regarding the last plugin class 2025-10-14 16:17:29 +01:00
Šarūnas Nejus
75a945d3d3
Initialise the last plugin class found in the plugin namespace 2025-10-14 15:14:55 +01:00
Jacob Danell
83858cd7ca Fixed too long text line 2025-10-14 14:08:30 +02:00
Jacob Danell
320ebf6a20 Fix misspelling 2025-10-14 14:07:45 +02:00
Šarūnas Nejus
dc9b498ee8
Fix dynamic versioning plugin not correctly installed in workflow (#6094)
It seems like the ci wokflows did not install the
poetry-dynamic-versioning correctly. We need a pipx inject for it to
work as expected.

closes #6089
2025-10-14 13:04:18 +01:00
Sebastian Mohr
31488e79da Removed additional linebreaks. 2025-10-14 12:58:54 +01:00
Sebastian Mohr
febb1d2e08 Removed test release file. 2025-10-14 12:58:54 +01:00
Sebastian Mohr
7f15a46081 Added perms to flow. 2025-10-14 12:58:54 +01:00
Sebastian Mohr
ac31bee4ca Reverted placeholder. 2025-10-14 12:58:54 +01:00
Sebastian Mohr
4ea37b4579 Added changelog entry fixed action to use sha. 2025-10-14 12:58:54 +01:00
Sebastian Mohr
d01f960e4f Fixed an issue where the poetry-dynamic-versioning-plugin was not used in
release artifacts.

Also adds a test_release workflow which allows to create the release
distribution.
2025-10-14 12:58:54 +01:00
Sebastian Mohr
77842b72d7
Adds a zero_disc_if_single_disc to the zero plugin (#6015)
Adds a `omit_single_disc` boolean configuration option to the zero
plugin for writing to files. Adds the logic that, if disctotal is set and 
there is only one disc in disctotal, that the disc is not set.

This keeps tags cleaner, only using disc on multi-disc albums. The
disctotal is not touched, particularly as this is not usually displayed
in most clients.

The field is removed only for writing the tags, but the disc number is
maintained in the database to avoid breaking anything that may depend on
a disc number or avoid possible loops or failed logic.

A column of disc 1 makes me feel there should be a disc 2, when most
albums are a single disc only.
2025-10-14 04:23:35 +02:00
Michael Krieger
df8cd23ae7 Add back tests as they were.
Add back tests as they were.
2025-10-14 03:17:34 +01:00
Michael Krieger
dc13308784 Remove tests. Update docs. Remove unnecessary return
Remove tests.  Update docs.  Remove unnecessary return.
2025-10-14 03:17:34 +01:00
Michael Krieger
b1c87cd98c Change parameter name, add return, add tests
Change the parameter name to omit_single_disc (vs previously zero_disc_if_single_disc)

Add return of 'fields_set' so that, if triggered by the command line `beets zero`, it will still effect the item.write.

Added tests.
2025-10-14 03:17:34 +01:00
Michael Krieger
5fc15bcfa4 Misc formatting changes 2025-10-14 03:17:34 +01:00
Michael Krieger
33b350a612 Adds a zero_disc_if_single_disc to the zero plugin
Adds a zero_disc_number_if_single_disc boolean to the zero plugin for writing to files. Adds the logic that, if disctotal is set and there is only one disc in disctotal, that the disc is not set.

This keeps tags cleaner, only using disc on multi-disc albums. The disctotal is not touched, particularly as this is not usually displayed in most clients.

The field is removed only for writing the tags, but the disc number is maintained in the database to avoid breaking anything that may depend on a disc number or avoid possible loops or failed logic.
2025-10-14 03:17:34 +01:00
Ember Light
0f0e38b0bf Add link in changelog 2025-10-12 22:40:55 +02:00
Ember Light
717809c52c Better custom_words documentation 2025-10-12 22:40:44 +02:00
Ember Light
b95a17d8d3 remove feat from custom_feat_words 2025-10-12 22:40:27 +02:00
Ember Light
af09e58fb0 Add new line after New features: 2025-10-12 21:40:22 +02:00
Ember Light
51c971f089 Fix sourcery-ai comments 2025-10-12 21:38:13 +02:00
Ember Light
e90738a6e2 Added changelog 2025-10-12 21:09:17 +02:00