1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

fix(entry): add update_content query parameter to make content updates optional

This commit is contained in:
AiraNadih 2025-04-17 12:49:42 +00:00
parent fc18540987
commit f8a845ccb7

View file

@ -331,12 +331,19 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
return
}
if err := h.store.UpdateEntryTitleAndContent(entry); err != nil {
json.ServerError(w, r, err)
shouldUpdateContent := request.QueryBoolParam(r, "update_content", false)
if shouldUpdateContent {
if err := h.store.UpdateEntryTitleAndContent(entry); err != nil {
json.ServerError(w, r, err)
return
}
json.OK(w, r, map[string]interface{}{"content": mediaproxy.RewriteDocumentWithRelativeProxyURL(h.router, entry.Content), "reading_time": entry.ReadingTime})
return
}
json.OK(w, r, map[string]interface{}{"content": mediaproxy.RewriteDocumentWithRelativeProxyURL(h.router, entry.Content), "reading_time": entry.ReadingTime})
json.OK(w, r, map[string]string{"content": entry.Content})
}
func (h *handler) flushHistory(w http.ResponseWriter, r *http.Request) {