## Problem
TIDAL album and track searches fail with HTTP 400 even after successful
authentication.
The plugin currently sends search queries as part of the URL path:
```text
GET /v2/searchResults/{query}
```
TIDAL’s current API requires the query through the `filter[query]`
parameter:
```text
GET /v2/searchResults?filter[query]={query}
```
The response format has also changed: `data` is now an array containing
the search-results resource rather than the resource object itself.
Fixes#6989.
## Fix
- Send search requests to `/v2/searchResults`.
- Pass the query using the required `filter[query]` parameter.
- Update the `SearchDocument` type for the new `data` array.
- Parse album and track relationships from the first search-results
resource.
- Handle empty search responses without raising an exception.
- Add regression coverage using a query that previously produced HTTP
400.
When `beet import -W` (`--nowrite`) is run with the scrub plugin enabled
(`auto=True`), the plugin was scrubbing (removing) tags even though
`--nowrite` means "don't write to files". This caused tags to be lost.
The fix adds a guard at the start of `import_task_files` to skip the
entire scrub operation when `should_write()` returns `False`, making the
scrub plugin respect the `--nowrite` flag like other plugins do.
## Fixes
Fixes#6958
## Changes
- `beetsplug/scrub.py`: Add guard in `import_task_files` to skip
scrubbing when `should_write()` returns `False`
- `test/plugins/test_scrub.py`: Update test to expect tags to remain
unchanged when `--nowrite` is passed (rename `test_tags_not_restored` to
`test_tags_not_scrubbed_when_nowrite`)
## Behavior Change
Before: `beet import -W` with scrub plugin would remove all tags from
imported files
After: `beet import -W` with scrub plugin will not modify files at all,
respecting `--nowrite`
Rewrite the `plexupdate` plugin around Plex's PIN authentication flow.
`beet plexupdate --auth` opens a browser, authenticates with Plex, and
stores the token and generated client identifier in `plex_token.json`
next to the beets configuration.
* Add `PlexSession` for token persistence, PIN polling, and
authenticated server requests.
* Use Plex's JSON API to find the music library section.
* Refresh the library once after modifying commands.
* Clearly report missing sections and `401` responses.
* Deprecate the manual `token` option in favor of interactive
authentication.
* Update documentation, tests, and changelog.
### Motivation
`plexupdate` could easily break after Plex deployments or instances were
updated, and manually obtaining a token isn't particularly
straightforward... This rewrite makes recovery simple: if authentication
breaks, users can just run the documented `beet plexupdate --auth`
command.
Rewrite the plugin documentation in the current style with dedicated
sections on authentication, usage, and configuration, and mark the
manual `token` option as deprecated. Add a changelog entry for the
new `beet plexupdate --auth` command.
Rewrite the plugin around Plex' PIN authentication flow: running
`beet plexupdate --auth` opens a browser window and stores the
obtained token together with a generated client identifier in a
token file (`plex_token.json`) next to the beets configuration.
- add a PlexSession (based on TimeoutAndRetrySession) that handles
token persistence, plex.tv PIN polling, and attaching the token to
local server requests
- look up the music library section through the JSON API instead of
parsing XML
- refresh the Plex library once, at the end of commands that changed
the library; report missing sections and 401 responses clearly
instead of failing silently
- deprecate the manual `token` configuration option in favor of the
interactive login
- Extends `.github/labeler.yaml` so the labeler can match not just
plugin names, but also plugin-specific command names and `beet ...` CLI
usage.
- Adds a new command-focused section for core commands like `config`,
`import`, `list`, `modify`, `update`, and others, giving them dedicated
labels.
- Architecturally, this keeps labeling logic centralized in one config
file while broadening the patterns that map PRs to labels.
- High-level impact: PRs that touch command docs, examples, or behavior
should now be labeled more accurately, which improves triage and makes
reviews easier to route.
- Small release-pipeline change: after `poe bump`, the workflow now also
runs `uv lock`. Grug see this as keeping version bump and lockfile sync
in one release step, instead of splitting responsibility.
- High-level impact: release commits now update the editable project
entry in `uv.lock` as well as the main project version. In this PR,
`beets` moves from `2.13.0` to `2.13.1` inside `uv.lock`.
- Reviewer takeaway: no app runtime behavior change. This is
release-process hardening to prevent version drift between the project
metadata and `uv.lock`.
Closes#6966
Tidal candidates now contribute track-length distance: the converted ISO
8601 duration is passed as `TrackInfo.length` instead of being stored as
a `duration` flex attribute.
- [x] Changelog.
- [x] Tests.
TrackInfo expects the converted ISO 8601 duration in its length
field. The plugin passed it as duration instead, which TrackInfo
silently stores as a flexible attribute while length stays None, so
Tidal candidates were matched without any track-length distance.
Pass the duration as length and update the parsing tests to assert
info.length instead of the incorrect info.duration flex field.
Fixes#6953
During interactive import, item-only fields configured in both
`albumfields` and `itemfields` were removed from the album header and
per-track documents.
Track fields are now excluded only when they are actually displayed in
the album header. Added a regression test for the `edit Candidates`
flow.
cc: @snejus
When `beet import -W` (--nowrite) is run with the scrub plugin
enabled (auto=True), the plugin was scrubbing (removing) tags even
though --nowrite means "don't write to files". This caused tags
to be lost.
The fix adds a guard at the start of import_task_files to skip
the entire scrub operation when should_write() returns False,
making the scrub plugin respect the --nowrite flag like other
plugins do.
Fixes#6958
## Description
The `web` command handler opens with `args = args`, which rebinds the
parameter to itself and does nothing. Nothing is missing behind it
either: `args` is already the third parameter of `func` and the two
`args.pop(0)` calls under it read the same list.
Going by the way beets used to receive command arguments, this reads
like a leftover from when the callback had to pull them out of somewhere
else.
## To Do
- [x] ~Documentation~ (removing a dead statement, nothing to describe)
- [x] ~Changelog~ (no user-visible change)
- [x] ~Tests~ (no behaviour to pin)
Two small follow up fixes after merging all typing changes:
1. Removed incorrect/outdated comment in `advancedrewrite`.
2. Included commits from the last PR to `.git-blame-ignore-revs`.
By overriding the format attribute of the item, beets comes up with a
destination path that the user expects.
## Description
Fixes#1360
Currently when doing a convert command, when beets determines what the
new file path should be, it uses the path to the original file, and
changes the extension, but the new format is not referenced at all when
determining the new destination path. This PR overrides the format
attribute of the item just before the destination path is resolved, thus
returning the path that takes the new format in mind.
## To Do
This is my first contribution to`beets` (and frankly, the first time
I've had reason to look at the codebase). There could very well be a
relevant class method I missed to better accomplish what I want rather
than overriding the `format` attribute
Fixes#6924.
- Enables repo-wide annotation checks in `pyproject.toml` via `ruff`'s
`flake8-annotations` rules, with practical carve-outs for `test/**`,
`docs/conf.py`, `Any`, and noisy variadic args. This adds a clear
enforcement layer without forcing annotations in low-value areas.
- Finishes typing the entire codebase, including command entrypoints,
import hooks, config-driven code, helper utilities, and
library/model-facing APIs. Architecturally, plugin boundaries now
describe their inputs and outputs explicitly instead of relying on
implicit contracts.
- Includes a small set of follow-on fixes uncovered by typing, mainly
around bytes vs. strings, optional values, and collection shapes. These
are mostly correctness and consistency fixes rather than intentional
behavior changes.
- Overall impact: this completes typing coverage for the full codebase.
The result is stronger static guarantees, clearer extension points, and
safer future refactors across both core and plugin code.
Part of #6924.
### What changed
- Types added to `beetsplug/duplicates.py`.
- Refactors `beetsplug/duplicates.py` so album and item commands now
share one execution path through `_run_command()`.
- Replaces the old generic `_merge()` dispatch with an explicit
`merge_func` passed into `_duplicates()`, so album and item merge
behavior stays separate but simpler.
- Tightens typing across the plugin by using clearer `Album`, `Item`,
`AlbumOrItem`, and `LibModel` annotations in the main helper methods.
### Why it matters
- The plugin's architecture is now more direct: command setup decides
`'albums'` vs `'items'`, and the shared duplicate-processing flow
handles the rest.
- This removes branching and type ambiguity from the core duplicate
logic, which makes the code easier to follow and safer to change.
- Functional behavior stays the same at a high level, but the plugin is
now easier to maintain, reason about, and extend.
Part of #6924.
- This PR is a typing and interface cleanup for `beetsplug/mpdstats.py`
and `beetsplug/thumbnails.py`. It does not add new features; it makes
the code's internal contracts clearer and more explicit.
- In `mpdstats`, MPD responses and `now_playing` state now have concrete
types, path lookup uses the correct beets path shape, and player event
handling is narrowed to known states. This makes the control flow easier
to follow and reduces hidden assumptions in the plugin.
- In `thumbnails`, the code stops passing full `Album` objects where
only `album.path` or `artpath` is needed. That separates album metadata
from file-path operations, removes ambiguity around optional
`album.artpath`, and makes thumbnail generation steps more direct.
- Tests were updated to match the narrower method signatures and the
corrected path handling.
- High-level impact: safer internal APIs, clearer data flow, and lower
risk of type-related bugs. The only visible behavior change is that
missing album art is now logged as a warning instead of info.