From a60f65f24e1db9d6cae018abccf4ebe5ed8f4a71 Mon Sep 17 00:00:00 2001 From: Felipe Martin <812088+fmartingr@users.noreply.github.com> Date: Sat, 29 Jul 2023 09:24:12 +0200 Subject: [PATCH] fix: title overwritten if user has defiend it (#684) --- internal/webserver/handler-api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/webserver/handler-api.go b/internal/webserver/handler-api.go index 8362a83..790324f 100644 --- a/internal/webserver/handler-api.go +++ b/internal/webserver/handler-api.go @@ -237,7 +237,7 @@ func (h *Handler) ApiInsertBookmark(w http.ResponseWriter, r *http.Request, ps h if payload.Async { go func() { - bookmark, err := downloadBookmarkContent(book, h.DataDir, r, !userHasDefinedTitle, book.Excerpt != "") + bookmark, err := downloadBookmarkContent(book, h.DataDir, r, userHasDefinedTitle, book.Excerpt != "") if err != nil { log.Printf("error downloading boorkmark: %s", err) return @@ -249,7 +249,7 @@ func (h *Handler) ApiInsertBookmark(w http.ResponseWriter, r *http.Request, ps h } else { // Workaround. Download content after saving the bookmark so we have the proper database // id already set in the object regardless of the database engine. - book, err = downloadBookmarkContent(book, h.DataDir, r, !userHasDefinedTitle, book.Excerpt != "") + book, err = downloadBookmarkContent(book, h.DataDir, r, userHasDefinedTitle, book.Excerpt != "") if err != nil { log.Printf("error downloading boorkmark: %s", err) } else if _, err := h.DB.SaveBookmarks(ctx, false, *book); err != nil {