Repository navigation
fix(tidal): honour search_limit in album and track query searches - #7197
thanvish21 wants to merge 1 commit into
Conversation
The tidal plugin's search_albums_by_query and search_tracks_by_query called api.search_results() without respecting the search_limit configured by the MetadataSourcePlugin base class. This caused Tidal to return 20+ candidates even when the user set e.g. `tidal: search_limit: 1`. Fix: read self.config["search_limit"].get(int) in both methods and slice the relationship list before resolving album/track IDs. Add focused tests for both album and track search with search_limit: 1 to guard against regressions. Closes: beetbox#6770 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7197 +/- ##
==========================================
- Coverage 80.86% 80.85% -0.01%
==========================================
Files 150 150
Lines 21232 21234 +2
Branches 3241 3241
==========================================
Hits 17169 17169
- Misses 3248 3250 +2
Partials 815 815
🚀 New features to boost your workflow:
|
|
Please see the other PRs and the discussion around this issue. IDs are not returned by any priority order therefore the fix here would not work. |
Problem
Closes #6770.
The tidal plugin's
search_albums_by_queryandsearch_tracks_by_querycalledapi.search_results()without respecting thesearch_limitconfigured byMetadataSourcePlugin. This caused Tidal to return 20+ candidates even when the user set e.g.:Root cause
Both query-search methods returned the full relationship list from the search document to the ID-resolution step. The shared
search_limitpath inMetadataSourcePlugin.search()was never reached becausecandidates()anditem_candidates()call these methods directly.Fix
Read
self.config["search_limit"].get(int)in both methods and slice the relationship list before passing IDs tosearch_albums_by_ids/ iterating tracks:Tests
Two new focused tests added in
test/plugins/test_tidal.py:TestCandidates::test_search_albums_respects_search_limit— verifies onlysearch_limitalbum IDs are requested when the API returns moreTestItemCandidates::test_search_tracks_respects_search_limit— verifies onlysearch_limittracks are returned from a multi-track search responseAll 62 tidal tests pass (
uv run pytest test/plugins/test_tidal.py).🤖 Generated with Claude Code