Commit graph

13259 commits

Author SHA1 Message Date
J0J0 Todos
f6ba5bcf01 docs: Move "Handling Paths" to "Developers" chapter 2025-10-28 12:56:04 +01:00
Šarūnas Nejus
52b102cfa8
Add support for Python 3.13 (#6132)
Fixes #5575
Fixes #5822
Fixes #6082
Fixes #6026

### Python 3.13 compatibility
- Updated `librosa` dependency from `^0.10.2.post1` to `>=0.11` where a
bug with `numpy` types is fixed.
- Updated transitive `audioread` dependency which now pulls in
`standard-aifc`, `standard-sunau`, and `audioop-lts` packages for Python
3.13 and above.

### Python 3.14 compatibility
- Python 3.14 introduced stricter requirements for input type in low
level `fnctl.ioctl` function which we used to detect the terminal width.
I replaced it with high-level, cross-platform
`shutil.get_terminal_size()`.
- I'm not adding official support yet, as I faced many issues trying to
install `librosa` dependencies on Python 3.14. It should work fine for
people that do not use `autobpm`, and it may even work for those that do
- if they have the right set of system dependencies available. We can
revise this once we drop Python 3.9 in a couple of days.
2025-10-28 10:32:38 +00:00
Šarūnas Nejus
cbd74b3167
Update confuse 2025-10-28 10:26:35 +00:00
Šarūnas Nejus
e76665bcfb
Do not support 3.14 for now, until we drop 3.9 in a couple of days 2025-10-28 10:26:34 +00:00
Šarūnas Nejus
fdc6d6e787
Revert "Try env var"
This reverts commit e30f7fbe9c.
2025-10-27 08:55:08 +00:00
Šarūnas Nejus
e30f7fbe9c
Try env var 2025-10-27 08:45:19 +00:00
Šarūnas Nejus
ec141dbfd6
Explicitly wrap partial with staticmethod for Py3.14 2025-10-27 08:23:37 +00:00
Šarūnas Nejus
77dffd551d
Add a note in the changelog 2025-10-27 08:23:37 +00:00
Šarūnas Nejus
3eb68ef830
Use cross-platform shutil.get_terminal_size to get term_width
This fixes Python 3.14 incompatibility.
2025-10-27 08:23:37 +00:00
Šarūnas Nejus
1ea3879aae
Upgrade librosa and audioread 2025-10-27 08:23:37 +00:00
J0J0 Todos
201677ae62
lastgenre: Plugin tuning log (-vvv) (#6007) 2025-10-25 17:38:42 +02:00
J0J0 Todos
4b1e5056d5 lastgenre: Document tuning log -vvv 2025-10-23 19:02:27 +02:00
J0J0 Todos
bf507cd5d4 Changelog for lastgenre tuning log #6007 2025-10-23 19:02:27 +02:00
J0J0 Todos
a8204f8cde lastgenre: -vvv tuning log helper, remove -d
Replace extended_debug config and CLI option with -vvv and add a helper
function.
2025-10-23 19:02:03 +02:00
henry
043581e0c9
Ftintitle: Continue even if albumartist and artist is the same (#6102)
## Description

This small PR allows ftintitle to process even if the artist/s in the
artist and albumartist fields are the same.

This fixes the problem with a lot of singles like [Porter Robinsons song
Shelter](https://musicbrainz.org/release/ccc261b9-e4cc-4965-81b8-7c92a5d28601)
and even [Rihanas's album
Umbrella](https://musicbrainz.org/release/60f8f1f5-485b-4637-8574-23f2bb98531f)

Without this fix the songs would end up with the feat. artist in the
artists folder-name and not the feat. in the songs filename.
Without:
`Rihanna feat. JAY‐Z\(2007) Umbrella\01 - Umbrella (radio edit).flac`
`Porter Robinson feat. Madeon\(2016) Shelter\01 - Shelter.flac`
With:
`Rihanna\(2007) Umbrella\01 - Umbrella (radio edit) feat. JAY‐Z.flac`
`Porter Robinson\(2016) Shelter\01 - Shelter feat. Madeon.flac`

I left the current way ftintitle works as the default so stuff doesn't
randomly change for users, but maybe it should is changed as the PR that
changed the ftintitle's behavour is only ~2 month old
https://github.com/beetbox/beets/pull/5943
Thoughts?

I'm also not super happy with the args name
`skip_if_artist_and_album_artists_is_the_same` so any suggestion what it
could be instead is more than welcome 😅


## 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-20 17:52:36 -07:00
Jacob Danell
bb541e22c3 Lint the docs 2025-10-20 15:28:33 +02:00
Ember Light
00e3da1a92
Merge branch 'master' into ftintitle-continue-even-if-albumartist-and-artist-is-the-same 2025-10-20 15:24:43 +02:00
Jacob Danell
027b775fcd Change arg name 2025-10-20 15:22:27 +02:00
Šarūnas Nejus
c26c342cc1
feat(plugin/web): support for nexttrack keypress (#6085)
This PR adds support for nexttrack keypress in the web plugin.

It uses feature detection for the Media Session API, and then
instantiates a metadata object for the session, and adds the specific
action handler for the nexttrack keypress.
2025-10-20 00:37:41 +01:00
Šarūnas Nejus
99987b3f27
Merge branch 'master' into feature/web-handle-nexttrack 2025-10-20 00:31:46 +01:00
Šarūnas Nejus
b850516a88
Fix transaction context manager signature (#6112)
Pyrefly reported the contect manager signature of Transaction as
invalid, so I corrected it.
2025-10-20 00:20:01 +01:00
Konstantin
72d879cf82
Merge branch 'master' into fix-invalid-contextmanager 2025-10-19 19:05:35 +02:00
Šarūnas Nejus
59874c5734
Use Generic instead of Any for cached_class_property (#6110)
In a plugin, self.data_source currently returns Any instead of str. This
change allows `cached_classproperty` to retain the type returned by the
decorated method.
2025-10-19 14:34:59 +01:00
Konstantin
12f2a1f694 fix mypy error 2025-10-19 15:12:27 +02:00
Konstantin
d713806263 fix transaction context manager signature 2025-10-19 15:07:17 +02:00
Konstantin
b924dfcd8c
Merge branch 'master' into generic-cached-classproperty 2025-10-19 10:09:21 +02:00
Konstantin
8a24518c4c use Generic instead of Any for cached_classproperty 2025-10-19 10:06:16 +02:00
J0J0 Todos
39aadf7099
Remove duplicate changelog entry (play plugin) 2025-10-19 08:50:25 +02:00
cvx35isl
1275ccf8c1
play plugin: $playlist marker for precise control where the playlist … (#4728)
…file is placed in the command

## Description

see included doc; placing the playlist filename at the end of command
just isn't working for all players

I have this in use with `mpv`

Co-authored-by: cvx35isl <cvx35isl@users.noreply.github.com>
Co-authored-by: J0J0 Todos <2733783+JOJ0@users.noreply.github.com>
2025-10-19 08:38:20 +02:00
Šarūnas Nejus
909b9aade4
fix(github/workflows): update to checkout v5, and setup-python v6. (#6086)
* Update github/actions used by ci and lint and others to the latest
versions.
2025-10-19 02:00:05 +01:00
Martin Atukunda
3ccc91d4d4 Drop 3.13 from python-version for now. 2025-10-19 01:53:17 +01:00
Martin Atukunda
e61ecb4496 fix(github/workflows): update to checkout v5, and setup-python v6.
* also run ci against python 3.13, which is default in debian trixie.
2025-10-19 01:53:17 +01:00
Šarūnas Nejus
7742631207
Add a consistent way to document configuration (#6088)
This PR introduces a custom Sphinx extension for documenting
configuration values and updates autotagger plugins documentation to use
consistent cross-reference formatting.

The main reason I introduced it is that I found the default `confval`
directive too verbose for our use case.

**Key Changes:**

### New Sphinx Extension (`docs/extensions/conf.py`)

- Added custom `conf` domain and directive for documenting configuration
values
- Provides `.. conf::` directive for defining config options with
default value support
- Adds `:conf:` role for creating cross-references to configuration
values
- Enables standardized documentation format:
  ```
  :conf:`plugins.plugin_name:option_name`
  ```

### Documentation Updates

- Converted inline configuration references to use `:conf:` role
throughout:
- `docs/changelog.rst`: Updated references to config options across
multiple plugin sections
  - Updated configuration documentation format:
    - `docs/plugins/discogs.rst`
    - `docs/plugins/musicbrainz.rst`
    - `docs/plugins/spotify.rst`
    - `docs/plugins/deezer.rst`
- Created `docs/plugins/shared_metadata_source_config.rst` for common
metadata source plugin options (`data_source_mismatch_penalty`,
`search_limit`, `source_weight`)

**Benefits:**

- Consistent, cross-referenceable configuration documentation
- Improved navigation between related config options
- Better maintainability through shared documentation snippets
- Enhanced release notes formatting for config references


https://github.com/user-attachments/assets/f7ee29b6-577a-468d-be58-b0aa648f28d0
2025-10-19 01:51:32 +01:00
Šarūnas Nejus
d83402fc65
Add a changelog note 2025-10-19 01:46:32 +01:00
Šarūnas Nejus
9519d47d57
Convert Python 2 URLs to Python 3 2025-10-19 01:37:42 +01:00
Šarūnas Nejus
861504d5f6
Make sure conf references are converted properly in release notes 2025-10-19 01:37:41 +01:00
Šarūnas Nejus
e872351170
Add references to configuration values in the changelog 2025-10-19 01:34:33 +01:00
Šarūnas Nejus
498b14ee1d
Convert autotagger plugin docs to use conf role 2025-10-19 01:34:33 +01:00
Šarūnas Nejus
a938449b29
Add Sphinx extension for configuration value documentation
Create a custom Sphinx extension to document configuration values with
a simplified syntax. It is based on the `confval` but takes less space
when rendered. The extension provides:

- A `conf` directive for documenting individual configuration values
  with optional type and default parameters
- A `conf` role for cross-referencing configuration values
- Automatic formatting of default values in the signature
- A custom domain that handles indexing and cross-references

For example, if we have

.. conf:: search_limit
    :default: 5

We refer to this configuration option with :conf:`plugins.discogs:search_limit`.

The extension is loaded by adding the docs/extensions directory to the
Python path and registering it in the Sphinx extensions list.
2025-10-19 01:34:32 +01:00
Ember Light
ca8df30ec3 Add missing test parameter 2025-10-16 19:06:56 +02:00
Ember Light
adb5b293f0
Update docs/plugins/ftintitle.rst
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-10-16 19:01:29 +02:00
Ember Light
9b33575a70
Update docs/changelog.rst
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-10-16 19:01:17 +02:00
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