feat: add outlier score formula and save decision

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
IgorVolochay
2026-10-25 10:49:23 +03:00
co-authored by Claude Sonnet 5.5
parent 8dbb0cf9ce
commit b52c847068
2 changed files with 53 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
export function computeScore(views, subscribers) {
if (subscribers === null || subscribers === undefined) return null;
return Math.round((views / Math.max(subscribers, 1)) * 100) / 100;
}
export function shouldSave({ views, score, vidiqScore }, { threshold, minViews }) {
if (vidiqScore !== null && vidiqScore !== undefined) return true;
return score !== null && score !== undefined && views >= minViews && score >= threshold;
}