4e596114c1c51f7eb10c8eff7305319addc1d3a0
list_channel previously matched every playlist with one unranked ".*keyword.*" regex, so a specific channel name could be buried pages behind unrelated names that merely contained the keyword mid-word. Split matches into two tiers (word-boundary match first, then anywhere-else) using a cheap count+skip/limit per tier so pagination still avoids pulling every match into memory. Also found while testing against a 1.19M-channel playlist: searching scans an unindexed regex and can take several seconds, and it was running synchronously inside the async handler, freezing every other request/socket for that whole time. Moved it to run_in_executor; verified a concurrent request now returns in ~2ms while a 3.6s search is in flight. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Description
No description provided
1.7 MiB
Languages
HTML
51.1%
Python
38.7%
JavaScript
9.3%
Shell
0.7%
Dockerfile
0.2%