This commit is contained in:
MDeeApp
2025-10-23 20:32:31 +02:00
parent 36dff70f98
commit cd5a179125
2 changed files with 75 additions and 17 deletions

View File

@@ -1526,6 +1526,27 @@ function calculateUrgencyScore(postItem) {
}
}
// Recent participation (<24h) should lower urgency regardless of deadline pressure
if (hoursSinceLastCheck < 24) {
const freshnessRatio = (24 - hoursSinceLastCheck) / 24; // 0 (at 24h) to 1 (just now)
const recencyPenalty = 60 + Math.round(freshnessRatio * 120); // 60-180 point penalty
score += recencyPenalty;
}
// Give extra priority to posts with deadlines approaching soon
if (hoursUntilDeadline < Infinity && remaining > 0) {
const urgencyWindowHours = 72;
const cappedHours = Math.min(hoursUntilDeadline, urgencyWindowHours);
const closenessRatio = 1 - (cappedHours / urgencyWindowHours); // 0-1
if (closenessRatio > 0) {
const baseBoost = Math.round(closenessRatio * 120); // Up to 120 points
const remainingFactor = Math.min(1.6, 0.7 + remaining * 0.3); // 1.0 (1 remaining) .. 1.6 (>=3 remaining)
const deadlineBoost = Math.round(baseBoost * remainingFactor);
score -= deadlineBoost;
}
}
return score;
}