feat: sqlite storage draft
This commit is contained in:
@ -5,8 +5,8 @@ import (
|
||||
|
||||
"donniemarko/internal/note"
|
||||
"donniemarko/internal/storage"
|
||||
"os"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
type NotesHandler struct {
|
||||
@ -55,6 +55,7 @@ func ParseNoteFile(path string) (*note.Note, error) {
|
||||
id := note.GenerateNoteID(path)
|
||||
nn := note.NewNote()
|
||||
nn.ID = id
|
||||
nn.Path = path
|
||||
nn.Content = string(content)
|
||||
nn.Title = note.ExtractTitle(nn.Content)
|
||||
// Use filename as title if no heading found
|
||||
@ -62,6 +63,6 @@ func ParseNoteFile(path string) (*note.Note, error) {
|
||||
nn.Title = filepath.Base(path)
|
||||
}
|
||||
nn.UpdatedAt = fileInfo.ModTime()
|
||||
nn.CreatedAt = fileInfo.ModTime()
|
||||
nn.Size = fileInfo.Size()
|
||||
return nn, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user