diff --git a/frontend/apps/reader/modules/readertypeset.lua b/frontend/apps/reader/modules/readertypeset.lua index 2929eb934..238d4e730 100644 --- a/frontend/apps/reader/modules/readertypeset.lua +++ b/frontend/apps/reader/modules/readertypeset.lua @@ -63,12 +63,12 @@ function ReaderTypeset:onReadSettings(config) G_reader_settings:readSetting("copt_page_margins") or DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM) - -- default to enable floating punctuation + -- default to disable floating punctuation -- the floating punctuation should not be boolean value for the following -- expression otherwise a false value will never be returned but numerical -- values will survive this expression self.floating_punctuation = config:readSetting("floating_punctuation") or - G_reader_settings:readSetting("floating_punctuation") or 1 + G_reader_settings:readSetting("floating_punctuation") or 0 self:toggleFloatingPunctuation(self.floating_punctuation) -- default to disable TXT formatting as it does more harm than good diff --git a/plugins/coverbrowser.koplugin/bookinfomanager.lua b/plugins/coverbrowser.koplugin/bookinfomanager.lua index 1885ec710..0dde7f091 100644 --- a/plugins/coverbrowser.koplugin/bookinfomanager.lua +++ b/plugins/coverbrowser.koplugin/bookinfomanager.lua @@ -503,6 +503,9 @@ end function BookInfoManager:removeNonExistantEntries() self:openDbConnection() local res = self.db_conn:exec("SELECT bcid, directory || filename FROM bookinfo") + if not res then + return _("Cache is empty. Nothing to prune.") + end local bcids = res[1] local filepaths = res[2] local bcids_to_remove = {} diff --git a/spec/unit/readerfooter_spec.lua b/spec/unit/readerfooter_spec.lua index b46819323..c392a20a6 100644 --- a/spec/unit/readerfooter_spec.lua +++ b/spec/unit/readerfooter_spec.lua @@ -146,7 +146,7 @@ describe("Readerfooter module", function() local timeinfo = footer.textGeneratorMap.time() local page_count = readerui.document:getPageCount() -- stats has not been initialized here, so we get na TB and TC - assert.are.same('1 / '..page_count..' | '..timeinfo..' | => 0 | B:0% | R:0% | TB: na | TC: na', + assert.are.same('1 / '..page_count..' | '..timeinfo..' | => 0 | B:0% | R:1% | TB: na | TC: na', footer.footer_text.text) end) @@ -545,7 +545,7 @@ describe("Readerfooter module", function() assert.is.same(0, footer.text_width) tapFooterMenu(fake_menu, "Progress percentage") - assert.are.same('R:0%', footer.footer_text.text) + assert.are.same('R:1%', footer.footer_text.text) assert.is.same(false, footer.has_no_mode) assert.is.same(footer.footer_text:getSize().w + footer.text_left_margin, footer.text_width) diff --git a/spec/unit/readerlink_spec.lua b/spec/unit/readerlink_spec.lua index 53ca53fff..032cfa3b3 100644 --- a/spec/unit/readerlink_spec.lua +++ b/spec/unit/readerlink_spec.lua @@ -18,7 +18,7 @@ describe("ReaderLink module", function() } readerui.rolling:onGotoPage(5) readerui.link:onTap(nil, {pos = {x = 340, y = 70}}) - assert.is.same(41, readerui.rolling.current_page) + assert.is.same(39, readerui.rolling.current_page) end) it("should jump to links in pdf page mode", function() @@ -55,7 +55,7 @@ describe("ReaderLink module", function() } readerui.rolling:onGotoPage(5) readerui.link:onTap(nil, {pos = {x = 340, y = 70}}) - assert.is.same(41, readerui.rolling.current_page) + assert.is.same(39, readerui.rolling.current_page) readerui.link:onGoBackLink() assert.is.same(5, readerui.rolling.current_page) end) diff --git a/spec/unit/readerrolling_spec.lua b/spec/unit/readerrolling_spec.lua index 5633d64c0..f00ff3acc 100644 --- a/spec/unit/readerrolling_spec.lua +++ b/spec/unit/readerrolling_spec.lua @@ -186,13 +186,13 @@ describe("Readerrolling module", function() it("should show pages for different word gap", function() readerui.document:setSpaceCondensing(100) readerui:handleEvent(Event:new("ChangeScreenMode", "portrait")) - assert.are.same(208, readerui.document:getPageCount()) + assert.are.same(191, readerui.document:getPageCount()) readerui.document:setSpaceCondensing(75) readerui:handleEvent(Event:new("ChangeScreenMode", "portrait")) - assert.are.same(205, readerui.document:getPageCount()) + assert.are.same(189, readerui.document:getPageCount()) readerui.document:setSpaceCondensing(50) readerui:handleEvent(Event:new("ChangeScreenMode", "portrait")) - assert.are.same(199, readerui.document:getPageCount()) + assert.are.same(189, readerui.document:getPageCount()) end) end) diff --git a/spec/unit/readersearch_spec.lua b/spec/unit/readersearch_spec.lua index 3ea8f9a2a..6b0b2a442 100644 --- a/spec/unit/readersearch_spec.lua +++ b/spec/unit/readersearch_spec.lua @@ -67,14 +67,14 @@ describe("Readersearch module", function() it("should find the last occurrence", function() -- local logger = require("logger") -- logger.info("nb of pages", doc:getPageCount()) - -- 20180613: currently 199 pages (20180602 was 200, was 202 before) + -- 20180723: currently 189 pages for i = 100, 180, 10 do rolling:onGotoPage(i) local words = search:searchFromEnd("Verona") assert.truthy(words) local pageno = doc:getPageFromXPointer(words[1].start) -- logger.info("last match on page", pageno) - assert.truthy(pageno > 195) + assert.truthy(pageno > 185) end for i = 230, 235, 1 do rolling:onGotoPage(i) diff --git a/spec/unit/readertoc_spec.lua b/spec/unit/readertoc_spec.lua index 97a63f22c..738355e98 100644 --- a/spec/unit/readertoc_spec.lua +++ b/spec/unit/readertoc_spec.lua @@ -22,10 +22,10 @@ describe("Readertoc module", function() assert.are.same(2, toc_max_depth) end) it("should get toc title from page", function() - title = toc:getTocTitleByPage(51) + title = toc:getTocTitleByPage(49) DEBUG("toc", toc.toc) assert(title == "SCENE V. A hall in Capulet's house.") - title = toc:getTocTitleByPage(154) + title = toc:getTocTitleByPage(143) assert(title == "SCENE I. Friar Laurence's cell.") end) describe("getTocTicks API", function() @@ -68,12 +68,12 @@ describe("Readertoc module", function() end) it("should get page left of chapter", function() assert.truthy(toc:getChapterPagesLeft(10, 0) > 10) - assert.truthy(toc:getChapterPagesLeft(101, 0) > 10) + assert.truthy(toc:getChapterPagesLeft(92, 0) > 10) assert.are.same(nil, toc:getChapterPagesLeft(200, 0)) end) it("should get page done of chapter", function() assert.truthy(toc:getChapterPagesDone(12, 0) < 5) - assert.truthy(toc:getChapterPagesDone(99, 0) < 5) + assert.truthy(toc:getChapterPagesDone(95, 0) < 5) assert.truthy(toc:getChapterPagesDone(204, 0) > 10) end) describe("collasible TOC", function()