From c8519eb5dd9ba77b8b462ad31572dab3e4548ca8 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sun, 31 Mar 2024 11:58:07 +0300 Subject: [PATCH] covermenu: use annotations --- plugins/coverbrowser.koplugin/covermenu.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/coverbrowser.koplugin/covermenu.lua b/plugins/coverbrowser.koplugin/covermenu.lua index 1a2b868be..e31db80a1 100644 --- a/plugins/coverbrowser.koplugin/covermenu.lua +++ b/plugins/coverbrowser.koplugin/covermenu.lua @@ -57,8 +57,14 @@ function CoverMenu:updateCache(file, status, do_create, pages) local percent_finished = doc_settings:readSetting("percent_finished") local summary = doc_settings:readSetting("summary") status = summary and summary.status - local highlight = doc_settings:readSetting("highlight") - local has_highlight = highlight and next(highlight) and true + local has_highlight + local annotations = doc_settings:readSetting("annotations") + if annotations then + has_highlight = #annotations > 0 + else + local highlight = doc_settings:readSetting("highlight") + has_highlight = highlight and next(highlight) and true + end self.cover_info_cache[file] = table.pack(pages, percent_finished, status, has_highlight) -- may be a sparse array else if self.cover_info_cache and self.cover_info_cache[file] then