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
+17 -1
View File
@@ -37,6 +37,20 @@ const handler = {
? `https:${rawThumb}`
: new URL(rawThumb, item.url || 'https://sepiasearch.org').toString()
: undefined;
// Dimensions max des fichiers (signal d'orientation pour isShortItem).
// Défensif : sepiasearch n'expose pas toujours `files`.
let fw = 0;
let fh = 0;
try {
for (const f of (Array.isArray(item.files) ? item.files : [])) {
const w = Number(f?.width);
const h = Number(f?.height);
if (Number.isFinite(w) && Number.isFinite(h) && w > 0 && h > 0 && w * h >= fw * fh) {
fw = w;
fh = h;
}
}
} catch {}
return {
title: item.name,
@@ -46,7 +60,9 @@ const handler = {
uploaderName: (item.account && (item.account.displayName || item.account.name)) || undefined,
channelId: (item.channel && (item.channel.name || item.channel.uuid)) || (item.account && item.account.name) || undefined,
type: 'video',
duration: typeof item.duration === 'number' && item.duration > 0 ? Math.round(item.duration) : undefined
duration: typeof item.duration === 'number' && item.duration > 0 ? Math.round(item.duration) : undefined,
...(fw > 0 ? { width: fw } : {}),
...(fh > 0 ? { height: fh } : {}),
};
});
} catch (error) {