Skip to content

CoverBrowser: fix cover cache check #2#11380

Merged
hius07 merged 2 commits intokoreader:masterfrom
hius07:fix-cover-browser-bookinfo-cache
Jan 17, 2024
Merged

CoverBrowser: fix cover cache check #2#11380
hius07 merged 2 commits intokoreader:masterfrom
hius07:fix-cover-browser-bookinfo-cache

Conversation

@hius07
Copy link
Copy Markdown
Member

@hius07 hius07 commented Jan 17, 2024

Related issue #11375.


This change is Reviewable

@Frenzie Frenzie added this to the 2024.02 milestone Jan 17, 2024
@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Jan 17, 2024

Looking at the changes, it seems you want cover_w/h even when not get_cover or has_cover ? In what situations ?

@hius07
Copy link
Copy Markdown
Member Author

hius07 commented Jan 17, 2024

local bookinfo = self:getBookInfo(filepath)
local to_extract = not bookinfo
if bookinfo and cover_specs and not bookinfo.ignore_cover then
if bookinfo.cover_fetched then
if bookinfo.has_cover and BookInfoManager.isCachedCoverInvalid(bookinfo, cover_specs) then
to_extract = true

Line 879, call without true as the 2nd arg.
cover_w and cover_h are used by isCachedCoverInvalid.

@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Jan 17, 2024

OK, you could also have just moved the 2 lines just before the if not get_cover then break:

                bookinfo["cover_w"] = tonumber(row[num])
                bookinfo["cover_h"] = tonumber(row[num+1])
            if not get_cover then
                -- don't bother making a blitbuffer
                break
            end

to avoid the 3 string comparisons on each column if col == "pages" or col == "cover_w" or col == "cover_h" then.

Btw, does this all work fine if, started from an empty bookinfo cache, having Mosaic with text covers (so, I gues no cover fetch), getting some stuff cached, and then switching to a mode with cover images?

@hius07
Copy link
Copy Markdown
Member Author

hius07 commented Jan 17, 2024

Yes, works fine with that case.

@hius07 hius07 merged commit e0ed04a into koreader:master Jan 17, 2024
@hius07 hius07 deleted the fix-cover-browser-bookinfo-cache branch January 17, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants