music-assistant-server

Branch:dev-lidarr-plugin

Commit Details

Fix YouTube Music search finding nothing when the language is not English (#6068)

# What does this implement/fix?

With the preferred language set to anything other than English, a
YouTube Music search
restricted to a single media type (a track search, an artist search, or
the Home Assistant
`music_assistant.search` action with `media_type`) returned zero
results. Searching without
a type filter kept working, so nothing looked broken.

The cause sits in `ytmusicapi`: it matches the result shelf title, which
YouTube returns
translated, against the English filter name. "Skladby" does not contain
"song", so the
whole shelf is thrown away and the search comes back empty. It only
worked where the
translated word happens to contain the English one (Dutch albums, French
artists).

The search call now always runs in English. Only the shelf/category
labels are translated,
the results themselves are identical, so nothing is lost. Everything
else in the provider
keeps using the server language.

**Related issue (if applicable):**

- related issue https://github.com/music-assistant/support/issues/6210

## Types of changes

- [x] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [ ] New feature (non-breaking change which adds functionality) —
`new-feature`
- [ ] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`

Changes:

- Always search YouTube Music in English, whatever the server language
is
- Bump the search cache checksum so the already-cached empty results are
dropped
- Add a regression test

## Checklist

- [x] The code change is tested and works locally.
- [x] `pre-commit run --all-files` passes.
- [x] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [ ] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [ ] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [x] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have [raised a PR against the documentation
repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md)
targeting the main or beta branch as appropriate.
Forgejo

Author

Marcel van der Veldt<[email protected]>
August 27, 2026 at 09:14 PM UTC

Committer

Marcel van der Veldt<[email protected]>
August 29, 2026 at 12:28 AM UTC
20additions
2deletions
3files changed

Parent commits

Changes

3 files
+20-2

Changed Files (3)

music_assistant/providers/ytmusic/
tests/providers/ytmusic/
music_assistant/providers/ytmusic/__init__.py
+2-2
music_assistant/providers/ytmusic/helpers.py
tests/providers/ytmusic/test_ytmusic.py
+18