aboutsummaryrefslogtreecommitdiff
path: root/ui/entry_scraper.go
diff options
context:
space:
mode:
authorGravatar Davide Masserut <dm@mssdvd.com> 2022-12-14 13:32:45 +0100
committerGravatar Frédéric Guillot <f@miniflux.net> 2022-12-14 19:53:04 -0800
commitc0ee3ed375ad3c51fe98faf9c4c92c0f6cfe4af2 (patch)
tree8b4c298ece088550162aa848d273fc8b87c6c5a3 /ui/entry_scraper.go
parentce35b46fee3c891e959d4e5376c26636e5eb90fc (diff)
downloadv2-c0ee3ed375ad3c51fe98faf9c4c92c0f6cfe4af2.tar.gz
v2-c0ee3ed375ad3c51fe98faf9c4c92c0f6cfe4af2.tar.zst
v2-c0ee3ed375ad3c51fe98faf9c4c92c0f6cfe4af2.zip
Update reading time HTML element after fetching the original web page
Diffstat (limited to 'ui/entry_scraper.go')
-rw-r--r--ui/entry_scraper.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/entry_scraper.go b/ui/entry_scraper.go
index a7cc0403..e556dc94 100644
--- a/ui/entry_scraper.go
+++ b/ui/entry_scraper.go
@@ -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})
}