summaryrefslogtreecommitdiff
path: root/internal/entry
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-18 11:35:41 +0300
committerPaul Buetow <paul@buetow.org>2024-10-18 11:35:41 +0300
commitcb3b67e54ac135376807486c808dfa2b830e38ff (patch)
treecd3d5ab7638928a525ca99ab1c25429b470df481 /internal/entry
parentc0ffb385eaca5dbe53817ee3c288f8dcee6b414f (diff)
updating entry timestamp after posting it
Diffstat (limited to 'internal/entry')
-rw-r--r--internal/entry/entry.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/entry/entry.go b/internal/entry/entry.go
index e1d9696..b8752e3 100644
--- a/internal/entry/entry.go
+++ b/internal/entry/entry.go
@@ -99,9 +99,8 @@ func (e *Entry) MarkPosted() error {
if e.State == Posted {
return errors.New("entry is already posted")
}
- // TODO: Also update the timestamp to reflect the posting time in the file path.
- // Write a timestamp.Update() function for this.
- if err := os.Rename(e.Path, strings.TrimSuffix(e.Path, ".queued")+".posted"); err != nil {
+ newPath := timestamp.UpdateInFilename(strings.TrimSuffix(e.Path, ".queued")+".posted", -2)
+ if err := os.Rename(e.Path, newPath); err != nil {
return err
}
e.State = Posted