Uses Unix milliseconds support from standard Go lib

This commit is contained in:
Deluan
2024-05-11 19:50:30 -04:00
parent ec68d69d56
commit 30ae468dc1
6 changed files with 10 additions and 43 deletions
+2 -3
View File
@@ -9,7 +9,6 @@ import (
"time"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/utils"
)
type Values struct {
@@ -61,7 +60,7 @@ func (r *Values) TimeOr(param string, def time.Time) time.Time {
if err != nil {
return def
}
t := utils.ToTime(value)
t := time.UnixMilli(value)
if t.Before(time.Date(1970, time.January, 2, 0, 0, 0, 0, time.UTC)) {
return def
}
@@ -81,7 +80,7 @@ func (r *Values) Times(param string) ([]time.Time, error) {
times[i] = time.Now()
continue
}
times[i] = utils.ToTime(ti)
times[i] = time.UnixMilli(ti)
}
return times, nil
}