fix(twitch,rumble,shorts): replis serveur, embed Rumble autoritaire, refonte UX Shorts
CI / build-and-test (push) Successful in 14m15s
CI / build-and-test (push) Successful in 14m15s
This commit is contained in:
@@ -302,6 +302,24 @@ async function searchChannelsMulti(queries, first, auth, after = '') {
|
||||
const handler = {
|
||||
id: 'tw',
|
||||
label: 'Twitch',
|
||||
/**
|
||||
* Top streams via le token serveur (retries inclus).
|
||||
* Utilisé par la route /api/twitch/top-streams : repli fiable quand les
|
||||
* appels Helix directs du navigateur échouent (proxy, CORS, 429...).
|
||||
* @param {number} limit
|
||||
*/
|
||||
async topStreams(limit = 24) {
|
||||
try {
|
||||
const appToken = await getAppAccessToken();
|
||||
const auth = { token: appToken.token, clientId: appToken.clientId };
|
||||
const first = String(Math.min(100, Math.max(1, Number(limit) || 24)));
|
||||
const data = await helixGet('/streams', new URLSearchParams({ first }), auth, { retries: 2 });
|
||||
return Array.isArray(data?.data) ? data.data.map(mapStream) : [];
|
||||
} catch (e) {
|
||||
console.error('Twitch topStreams error:', e?.message || e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Recherche mixte : lives + VODs + clips + chaînes.
|
||||
* @param {string} q
|
||||
|
||||
Reference in New Issue
Block a user