fix(parser): correct priority calculation for 'Z' to return 0

Previously, the priority calculation did not handle 'Z' correctly,
resulting in a non-zero value. Now, 'Z' returns 0 as intended, and the
step size is calculated for a linear scale.
This commit is contained in:
2025-11-25 00:40:16 +01:00
parent 20e327d9dd
commit 57ac41ff72

View File

@@ -35,8 +35,12 @@ func (t Task) PriorityAsRemind() int {
if p < 'A' || p > 'Z' {
return 5000
}
// A=9999, Z=0, linear scale
return 9999 - int(p-'A')*400
step := 9999 / 25 // 399
val := 9999 - int(p-'A')*step
if p == 'Z' {
return 0
}
return val
}
func (t Task) MarshalJSON() ([]byte, error) {