Compare commits

...

3 Commits

Author SHA1 Message Date
bfb1bb3433 chore: update version to v2.0.0 in main.go
To make `go install` happy :-|
2025-11-26 16:39:10 +01:00
676ef83e50 chore: bump version to v2 in main.go 2025-11-26 16:24:55 +01:00
adbc2cf364 fix(parser): improve priority calculation accuracy using math.Round
Refactored PriorityAsRemind to use floating point division and rounding
for more precise priority mapping.
2025-11-26 16:24:28 +01:00
3 changed files with 8 additions and 9 deletions

2
go.mod
View File

@@ -1,4 +1,4 @@
module git.donadeo.net/pdonadeo/todotxt2remind
module git.donadeo.net/pdonadeo/todotxt2remind/v2
go 1.24.1

View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"math"
"regexp"
"strings"
"time"
@@ -104,12 +105,10 @@ func (t Task) PriorityAsRemind() int {
if p < 'A' || p > 'Z' {
return 5000
}
step := 9999 / 25 // 399
val := 9999 - int(p-'A')*step
if p == 'Z' {
return 0
}
return val
pInt := int(p) - 65 // 'A' = 65
value := 9999 - (float64(pInt) * (float64(9999) / float64(25)))
value = math.Round(value)
return int(value)
}
func (t Task) MarshalJSON() ([]byte, error) {

View File

@@ -6,7 +6,7 @@ import (
"io"
"os"
"git.donadeo.net/pdonadeo/todotxt2remind/internal/parser"
"git.donadeo.net/pdonadeo/todotxt2remind/v2/internal/parser"
"github.com/spf13/cobra"
)
@@ -14,7 +14,7 @@ var (
inputFile string
outputFile string
debug bool
version = "1"
version = "v2.0.0"
)
func main() {