feat(search): drop quota wording when the live search source is scrape

The search response now reports its source; in scrape mode (zero quota) the
results banner and Load-more button drop the 'uses quota' wording. Adds the
search_source toggle's labels/hints and updates the per-user-limit hint to note
the cost only applies to the api source. EN/HU/DE.
This commit is contained in:
npeter83 2026-06-29 22:30:03 +02:00
parent 396e09189b
commit 1d6dfaf486
8 changed files with 35 additions and 12 deletions

View file

@ -82,6 +82,9 @@ export interface FeedResponse {
// Opaque keyset cursor for the next page, or null when this is the last page.
next_cursor: string | null;
limit: number;
// Only set by the live YouTube search: "scrape" (InnerTube, no API quota) or "api"
// (search.list, 100 units/page) — lets the UI drop the quota warning in scrape mode.
source?: "scrape" | "api";
}
export interface Playlist {
@ -565,7 +568,8 @@ export const api = {
req(`/api/feed/count?${filterParams(f).toString()}`),
// Live YouTube search: results are materialised into the catalog and returned as feed cards.
// `quiet` so the YT-search panel can render quota/limit errors (incl. 429) inline instead of
// popping the global modal. `cursor` is the YouTube nextPageToken (each page spends 100 units).
// popping the global modal. `cursor` is the next-page token (an InnerTube continuation token
// in scrape mode, or a Data API pageToken in api mode); the response's `source` says which.
searchYoutube: (q: string, cursor: string | null): Promise<FeedResponse> => {
const p = new URLSearchParams({ q });
if (cursor) p.set("cursor", cursor);