Fix review findings: dual-entry image capture, image blob GC at limit, stdin drain, fuzzy query edge cases, uri encoding, GC queue, temp-file pruning, theme border widths

This commit is contained in:
2026-09-05 15:43:33 +01:00
parent 44808ffd2c
commit 63a003e4a5
11 changed files with 73 additions and 41 deletions
+4 -11
View File
@@ -65,10 +65,11 @@ function parseQuery(q) {
var canonical = TYPE_ALIASES[wanted]
if (canonical) { out.type = canonical; continue }
// prefix match: "type:im" → image
var matchedType = ""
for (var key in TYPE_ALIASES) {
if (key.indexOf(wanted) === 0) { out.type = TYPE_ALIASES[key]; break }
if (key.indexOf(wanted) === 0) { matchedType = TYPE_ALIASES[key]; break }
}
if (out.type) continue
if (matchedType) { out.type = matchedType; continue }
// unknown type — treat the whole token as a term
out.terms.push(tok)
continue
@@ -91,7 +92,7 @@ function parseQuery(q) {
if (AGE_WORDS[lower] !== undefined) {
out.maxAge = AGE_WORDS[lower]
if (lower === "yesterday") out.minAge = 0 // refined below relative to now; caller passes now
if (lower === "yesterday") out.minAge = 86400
continue
}
@@ -219,14 +220,6 @@ function ageFilterOk(parsed, ageSeconds) {
return true
}
// "yesterday" means older than 24h but within 48h.
function refineYesterday(parsed, now) {
// Only applies when the query contained the bare word "yesterday" and no
// explicit duration bounds; approximated by caller passing minAge via the
// maxAge=172800 already set. We require age > 86400 - slack handled here.
return parsed
}
function recencyBonus(ts, now) {
if (!ts) return 0
var ageDays = Math.max(0, (now - ts) / 86400)