feat: détection short par orientation vidéo
CI / build-and-test (push) Successful in 14m6s

Règle partagée front/back : flag natif, verticale stricte (ratio ≤ 0.8, ≤ 90 s), verticale sans durée jamais short, repli durée (70 YT / 75 autres). Dimensions alimentées par Dailymotion/Odysee/PeerTube, flag maison Rumble supprimé, condition innertube morte simplifiée. Shorts : langues utilisateur (UI + transcripts) via relevanceLanguage/languageOneOf/Twitch language, son activé par défaut.
This commit is contained in:
2026-09-29 12:17:10 -04:00
parent 3f4cd56f14
commit f443a470f9
22 changed files with 454 additions and 73 deletions
+7 -1
View File
@@ -40,6 +40,10 @@ const handler = {
const name = item.name || '';
const claimId = item.claimId || item.claim_id || '';
const urlSegment = claimId ? `${encodeURIComponent(name)}:${claimId}` : encodeURIComponent(name);
// Dimensions vidéo (signal d'orientation pour isShortItem) quand
// lighthouse les expose — lecture défensive, aucun appel en plus.
const vw = Number(item.video?.width ?? item.video?.video_width ?? item.width);
const vh = Number(item.video?.height ?? item.video?.video_height ?? item.height);
return {
title: item.title || name,
@@ -50,7 +54,9 @@ const handler = {
type: 'video',
duration: typeof item.duration === 'number' && item.duration > 0
? Math.round(item.duration)
: (typeof item.video?.duration === 'number' && item.video.duration > 0 ? Math.round(item.video.duration) : undefined)
: (typeof item.video?.duration === 'number' && item.video.duration > 0 ? Math.round(item.video.duration) : undefined),
...(Number.isFinite(vw) && vw > 0 ? { width: vw } : {}),
...(Number.isFinite(vh) && vh > 0 ? { height: vh } : {}),
};
});
} catch (error) {