OTM: Attempt to deal with wonky config states (#10429)

Such states (not quite sure how you could actively get in such a broken state to begin with, mind you)  could lead to an attempt to load an old fontlist cache in an incompatible format.

Re: #9771
This commit is contained in:
NiLuJe
2023-05-13 20:44:39 +02:00
committed by GitHub
parent fdea39c2d6
commit 5c353c2289

View File

@@ -32,6 +32,15 @@ end
if last_migration_date < 20200421 then
logger.info("Performing one-time migration for 20200421")
-- Drop the Fontlist cache early, in case it's in an incompatible format for some reason...
-- c.f., https://github.com/koreader/koreader/issues/9771#issuecomment-1546308746
-- (This is basically the 20220914 migration step applied preemptively, as readertypography *will* attempt to load it).
local cache_path = DataStorage:getDataDir() .. "/cache/fontlist"
local ok, err = os.remove(cache_path .. "/fontinfo.dat")
if not ok then
logger.warn("os.remove:", err)
end
local ReaderTypography = require("apps/reader/modules/readertypography")
-- Migrate old readerhyphenation settings
-- (but keep them in case one goes back to a previous version)