mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-06 13:05:30 +08:00
Fix title is empty when adding bookmark
This commit is contained in:
parent
035658d405
commit
28ee496a68
2 changed files with 10 additions and 0 deletions
|
@ -104,6 +104,11 @@ func addHandler(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
}
|
||||
|
||||
// Make sure bookmark's title not empty
|
||||
if book.Title == "" {
|
||||
book.Title = book.URL
|
||||
}
|
||||
|
||||
// Save bookmark to database
|
||||
_, err = db.SaveBookmarks(book)
|
||||
if err != nil {
|
||||
|
|
|
@ -278,6 +278,11 @@ func (h *handler) apiInsertBookmark(w http.ResponseWriter, r *http.Request, ps h
|
|||
}
|
||||
}
|
||||
|
||||
// Make sure bookmark's title not empty
|
||||
if book.Title == "" {
|
||||
book.Title = book.URL
|
||||
}
|
||||
|
||||
// Save bookmark to database
|
||||
results, err := h.DB.SaveBookmarks(book)
|
||||
if err != nil || len(results) == 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue