Skip to content

musicbrainz: deprecated searchlimit option is silently ignored since 2.4.0 #7231

Backlog

Description

@Taruper

Problem

With the following config, MusicBrainz still returns only 5 candidates instead of 20, and no deprecation warning is shown:

musicbrainz:
  searchlimit: 20

Running an import in verbose (-vv) mode shows that the request is sent with limit=5:

$ beet -vv import -q /path/to/album
Searching for MusicBrainz releases with: 'release:(the hit\-singles) artist:(falco)'
... url: /ws/2/release?limit=5&query=release%3A...

With search_limit: 20 instead, the same command sends limit=20.

I checked the actual request across versions with the same config:

  • 2.3.1: limit=20
  • 2.4.0, 2.5.0 and 2.14.1: limit=5, no warning

The compatibility code in MusicBrainzPlugin.__init__ (beetsplug/musicbrainz.py, lines 290-299 in 2.14.1) reads:

self.config["match"]["searchlimit"]

However, self.config already points to the musicbrainz section, so this looks up musicbrainz.match.searchlimit, which never existed. The NotFoundError is suppressed, so the old setting is dropped and no warning is shown.

This came in with the rename in #5960 (beets 2.4.0). An automated Copilot review comment there suggested self.config["searchlimit"]; the author acknowledged it, but the follow-up commit kept ["match"].

searchlimit was the documented option up to 2.3.x, and users were advised to raise it (for example in #4882). Those configs now silently fall back to 5.

A possible fix:

self.config["search_limit"] = self.config["searchlimit"].get(int)

Two things to decide: with this fix, the old key wins if both are set, and an invalid value would make the plugin fail to load instead of failing at search time.

Changing searchlimit to search_limit in my config fixed it for me.

I used an AI assistant to help trace the code and history; I checked the findings and reproduced them myself and can answer questions.

Setup

  • OS: Linux (linuxserver/beets Docker image on a NAS)
  • Python version: 3.12.16
  • beets version: 2.14.1
  • Turning off plugins made problem go away (yes/no): n/a (the problem is in the musicbrainz plugin)

My configuration (relevant part):

plugins: [musicbrainz, ...]
musicbrainz:
  searchlimit: 20

Activity

  1. Sabrina04072003 commented on Dec 1, 2026

    @Sabrina04072003
    Contributor

    Hi , I would like to work on this issue .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    musicbrainz

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions