weiter
This commit is contained in:
21
web/app.js
21
web/app.js
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user