aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/data/put.go
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-06-12 02:32:48 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-06-12 02:32:48 -0400
commit61d89ee58e6a4d990e6e81c951731c80c2cd1ece (patch)
tree9c205528083ec7a22f9a508a23cd0a1dca9c9be7 /pkg/data/put.go
parenteec51c3c4c5cde3135a8219cff8e6e0e54918918 (diff)
Minor bug fix
Diffstat (limited to 'pkg/data/put.go')
-rw-r--r--pkg/data/put.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/data/put.go b/pkg/data/put.go
index ac0dabc..a5237ae 100644
--- a/pkg/data/put.go
+++ b/pkg/data/put.go
@@ -131,11 +131,9 @@ func (p *PutMany) documents(ctx context.Context) error {
// future inserts
for _, doc := range p.pathDocs {
title := sql.NullString{String: doc.Title, Valid: doc.Title != ""}
- dateUnix := doc.Date.Unix()
- date := sql.NullInt64{Int64: dateUnix, Valid: dateUnix != 0}
+ date := sql.NullInt64{Int64: doc.Date.Unix(), Valid: !doc.Date.IsZero()}
- filetimeUnix := doc.FileTime.Unix()
- filetime := sql.NullInt64{Int64: filetimeUnix, Valid: filetimeUnix != 0}
+ filetime := sql.NullInt64{Int64: doc.FileTime.Unix(), Valid: !doc.FileTime.IsZero()}
meta := sql.NullString{String: doc.OtherMeta, Valid: doc.OtherMeta != ""}