fix(tidal): honor search_limit when searching albums and tracks - #6905
Open
seedaylight wants to merge 1 commit into
Open
fix(tidal): honor search_limit when searching albums and tracks#6905seedaylight wants to merge 1 commit into
seedaylight wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The Tidal plugin now honors the
search_limitconfiguration option whensearching for albums and tracks.
search_albums_by_query()andsearch_tracks_by_query()read the configured limit and cap the candidatelists returned by the Tidal search results endpoint, matching the behavior of
the other metadata source plugins.
Why
tidal.search_limitis documented (default 5) but was previously ignored: theplugin implements its own candidate search path that calls the Tidal API
directly and returns the full result set. Users setting
search_limit: 1stillreceived 20+ candidates. See #6770.
How
The Tidal searchResults API reference does not document a server-side
limitparameter, 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
TestSearchLimitwith focused tests for both album and track searchusing
search_limit: 1intest/plugins/test_tidal.py.pytest test/plugins/test_tidal.py: 49 passed.ruff check,ruff format --check, andmypyon the changed module pass.test/plugins/run: 273 passed; the single failure(
test_fetchart.py::TestFetchartCli::test_colorization) is a pre-existingenvironment issue (ANSI color output disabled in the local shell) and also
fails on
masterwithout this change.authentication); tests use mocked API responses consistent with the existing
suite.
Fixes #6770