Add /ping and /health endpoints, fix two logic bugs and Fix slow, 5-result-capped search: use search.getResults, drop N+1 calls - #77
Open
RobinkumarJ246 wants to merge 2 commits into
Conversation
Fix except clause in helper.py that never caught TypeError, and fix an always-true elif condition in the /result/ route. Also add CLAUDE.md for repo guidance. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
search_for_song() was calling JioSaavn's autocomplete.get (capped at ~5 results) for the initial search, then making ANOTHER sequential get_song() HTTP request per result just to fetch playable media URLs — 6+ round-trips to JioSaavn's origin for a single search. search.getResults (JioSaavn's actual search API, supports p/n paging) already returns encrypted_media_url/media_preview_url/duration/etc for every result in the same response, so format_song() can run on each result directly with zero extra requests. Verified locally: 15 results in ~0.2-0.4s versus the old ~5-result, multi-second behavior. /song/ now accepts an optional n= param (default 15, capped at 40) to control result count. The songdata=false lightweight path is untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@RobinkumarJ246 is attempting to deploy a commit to the cyberboy's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fix except clause in helper.py that never caught TypeError, and fix
an always-true elif condition in the /result/ route.
search_for_song() was calling JioSaavn's autocomplete.get (capped at ~5
results) for the initial search, then making ANOTHER sequential
get_song() HTTP request per result just to fetch playable media URLs
— 6+ round-trips to JioSaavn's origin for a single search.
search.getResults (JioSaavn's actual search API, supports p/n paging)
already returns encrypted_media_url/media_preview_url/duration/etc for
every result in the same response, so format_song() can run on each
result directly with zero extra requests. Verified locally: 15 results
in ~0.2-0.4s versus the old ~5-result, multi-second behavior.
/song/ now accepts an optional n= param (default 15, capped at 40) to
control result count. The songdata=false lightweight path is untouched.