Popular tab: rank by real view_count, drop broken ?sort=p URL

yt-dlp's own test suite marks channel sort as 'Query for sorting no
longer works' — YouTube blocked it. New approach: fetch view_count for
up to 200 indexed videos in parallel (8 workers, prioritising those
missing counts), then Popular tab sorts by view_count DESC WHERE
view_count IS NOT NULL. Accurate for any channel once enrichment runs.
Frontend refetch wait raised to 60s to cover ~200 parallel fetches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 23:02:03 +02:00
parent 3e699d61b6
commit ff4d8e4ab4
2 changed files with 55 additions and 149 deletions

View File

@@ -117,7 +117,7 @@ export default function ChannelPage() {
const popularMut = useMutation({
mutationFn: () => fetchPopularVideos(id),
onSuccess: () => scheduleRefetch(8000),
onSuccess: () => scheduleRefetch(60000),
});
const deepSearchMut = useMutation({
@@ -495,7 +495,7 @@ export default function ChannelPage() {
{activeQ
? `No indexed videos match "${activeQ}"`
: tab === "popular"
? "No popular videos fetched yet."
? "No view counts yet — click \"Fetch popular\" to rank indexed videos by views."
: "No videos indexed yet."}
</p>
{activeQ ? (