Skip to content

Commit

Permalink
main: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
hius07 authored Sep 23, 2024
1 parent 50e96e9 commit bc66938
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/statistics.koplugin/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,9 @@ function ReaderStatistics:getIdBookDB()
local title, authors = self.data.title, self.data.authors
local result = stmt:reset():bind(title, authors, self.doc_md5):step()
local nr_id = tonumber(result[1])
if nr_id == 0 and self.ui.paging then -- old strings are null-terminated
if nr_id == 0 and self.ui.paging then
-- In the past, title and/or authors strings, got from MuPDF, may have been or not null terminated.
-- We need to check with all combinations if a book with these null terminated exists, and use it.
title = title .. "\0"
result = stmt:reset():bind(title, authors, self.doc_md5):step()
nr_id = tonumber(result[1])
Expand Down

0 comments on commit bc66938

Please sign in to comment.