From 7e5fb006bb5bf5e089a8e8b3c400b48d35d96ff3 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:46:40 +0300 Subject: [PATCH] Update readerannotation.lua --- .../apps/reader/modules/readerannotation.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/apps/reader/modules/readerannotation.lua b/frontend/apps/reader/modules/readerannotation.lua index 0123922a4..e998749cd 100644 --- a/frontend/apps/reader/modules/readerannotation.lua +++ b/frontend/apps/reader/modules/readerannotation.lua @@ -169,14 +169,14 @@ function ReaderAnnotation:createAnnotations(config) if config:has("bookmarks_paging") then -- save incompatible old backup local bookmarks_paging = config:readSetting("bookmarks_paging") local highlights_paging = config:readSetting("highlight_paging") - local annotations_paging = self:getAnnotationsFromBookmarksHighlights(bookmarks_paging, highlights_paging) - config:saveSetting("annotations_paging", annotations_paging) + local annotations = self:getAnnotationsFromBookmarksHighlights(bookmarks_paging, highlights_paging) + config:saveSetting("annotations_paging", annotations) config:delSetting("bookmarks_paging") config:delSetting("highlight_paging") end else -- incompatible format loaded, or empty if has_bookmarks then -- save incompatible format if not empty - annotations = self:getAnnotationsFromBookmarksHighlights(bookmarks, highlights) + local annotations = self:getAnnotationsFromBookmarksHighlights(bookmarks, highlights) config:saveSetting("annotations_paging", annotations) end -- load compatible format @@ -190,14 +190,14 @@ function ReaderAnnotation:createAnnotations(config) if config:has("bookmarks_rolling") then local bookmarks_rolling = config:readSetting("bookmarks_rolling") local highlights_rolling = config:readSetting("highlight_rolling") - local annotations_rolling = self:getAnnotationsFromBookmarksHighlights(bookmarks_rolling, highlights_rolling) - config:saveSetting("annotations_rolling", annotations_rolling) + local annotations = self:getAnnotationsFromBookmarksHighlights(bookmarks_rolling, highlights_rolling) + config:saveSetting("annotations_rolling", annotations) config:delSetting("bookmarks_rolling") config:delSetting("highlight_rolling") end else if has_bookmarks then - annotations = self:getAnnotationsFromBookmarksHighlights(bookmarks, highlights) + local annotations = self:getAnnotationsFromBookmarksHighlights(bookmarks, highlights) config:saveSetting("annotations_rolling", annotations) end bookmarks = config:readSetting("bookmarks_paging") or {} @@ -317,7 +317,7 @@ function ReaderAnnotation:getItemIndex(item, no_binary) end end end - + if not no_binary then local isInOrder = self.ui.rolling and self.isItemInPositionOrderRolling or self.isItemInPositionOrderPaging local _start, _end, _middle = 1, #self.annotations @@ -333,7 +333,7 @@ function ReaderAnnotation:getItemIndex(item, no_binary) end end end - + for i, v in ipairs(self.annotations) do if doesMatch(item, v) then return i