diff --git a/internal/api/entry.go b/internal/api/entry.go index 2af2b3c7..f8d1ce69 100644 --- a/internal/api/entry.go +++ b/internal/api/entry.go @@ -275,7 +275,9 @@ func (h *handler) updateEntry(w http.ResponseWriter, r *http.Request) { } entryUpdateRequest.Patch(entry) - entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed) + if user.ShowReadingTime { + entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed) + } if err := h.store.UpdateEntryTitleAndContent(entry); err != nil { json.ServerError(w, r, err) diff --git a/internal/reader/processor/processor.go b/internal/reader/processor/processor.go index 0656670f..7c1b6b1d 100644 --- a/internal/reader/processor/processor.go +++ b/internal/reader/processor/processor.go @@ -204,7 +204,9 @@ func ProcessEntryWebPage(feed *model.Feed, entry *model.Entry, user *model.User) if content != "" { entry.Content = content - entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed) + if user.ShowReadingTime { + entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed) + } } rewrite.Rewriter(websiteURL, entry, entry.Feed.RewriteRules) @@ -282,7 +284,9 @@ func updateEntryReadingTime(store *storage.Storage, feed *model.Feed, entry *mod } // Handle YT error case and non-YT entries. if entry.ReadingTime == 0 { - entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed) + if user.ShowReadingTime { + entry.ReadingTime = readingtime.EstimateReadingTime(entry.Content, user.DefaultReadingSpeed, user.CJKReadingSpeed) + } } }