1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Update reading time HTML element after fetching the original web page

This commit is contained in:
Davide Masserut 2022-12-14 13:32:45 +01:00 committed by Frédéric Guillot
parent ce35b46fee
commit c0ee3ed375
3 changed files with 7 additions and 3 deletions

View file

@ -9,6 +9,7 @@ import (
"miniflux.app/http/request"
"miniflux.app/http/response/json"
"miniflux.app/locale"
"miniflux.app/model"
"miniflux.app/proxy"
"miniflux.app/reader/processor"
@ -64,5 +65,7 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
json.ServerError(w, r, err)
}
json.OK(w, r, map[string]string{"content": proxy.ImageProxyRewriter(h.router, entry.Content)})
readingTime := locale.NewPrinter(user.Language).Plural("entry.estimated_reading_time", entry.ReadingTime, entry.ReadingTime)
json.OK(w, r, map[string]string{"content": proxy.ImageProxyRewriter(h.router, entry.Content), "reading_time": readingTime})
}