Skip to content

fix(tidal): honor search_limit when searching albums and tracks - #6905

Open
seedaylight wants to merge 1 commit into
beetbox:masterfrom
seedaylight:fix/tidal-search-limit
Open

fix(tidal): honor search_limit when searching albums and tracks#6905
seedaylight wants to merge 1 commit into
beetbox:masterfrom
seedaylight:fix/tidal-search-limit

Conversation

@seedaylight

Copy link
Copy Markdown

What changed

The Tidal plugin now honors the search_limit configuration option when
searching for albums and tracks. search_albums_by_query() and
search_tracks_by_query() read the configured limit and cap the candidate
lists returned by the Tidal search results endpoint, matching the behavior of
the other metadata source plugins.

Why

tidal.search_limit is documented (default 5) but was previously ignored: the
plugin implements its own candidate search path that calls the Tidal API
directly and returns the full result set. Users setting search_limit: 1 still
received 20+ candidates. See #6770.

How

The Tidal searchResults API reference does not document a server-side limit
parameter, so the candidate relationship lists are truncated client-side to the
configured limit before track/album IDs are resolved. This guarantees the
option is honored regardless of API pagination defaults.

Testing

  • Added TestSearchLimit with focused tests for both album and track search
    using search_limit: 1 in test/plugins/test_tidal.py.
  • pytest test/plugins/test_tidal.py: 49 passed.
  • ruff check, ruff format --check, and mypy on the changed module pass.
  • Full test/plugins/ run: 273 passed; the single failure
    (test_fetchart.py::TestFetchartCli::test_colorization) is a pre-existing
    environment issue (ANSI color output disabled in the local shell) and also
    fails on master without this change.
  • Not verified against the live Tidal API (requires Tidal account
    authentication); tests use mocked API responses consistent with the existing
    suite.

Fixes #6770

@seedaylight
seedaylight requested review from a team and semohr as code owners August 5, 2026 00:50
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.71%. Comparing base (b9c7c13) to head (7f211b8).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6905      +/-   ##
==========================================
+ Coverage   75.70%   75.71%   +0.01%     
==========================================
  Files         163      163              
  Lines       21430    21432       +2     
  Branches     3389     3389              
==========================================
+ Hits        16224    16228       +4     
+ Misses       4406     4405       -1     
+ Partials      800      799       -1     
Files with missing lines Coverage Δ
beetsplug/tidal/__init__.py 89.91% <100.00%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tidal: search_limit is ignored

1 participant