mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Centralize one time migration code after updates (#7531)
There have been a couple of these this month, and keeping stuff that should only ever run once piling up in their respective module was getting ugly, especially when it's usually simple stuff (settings, files). So, move everything to a dedicated module, run by reader.lua on startup, and that will actually only do things once, when necessary.
This commit is contained in:
@@ -24,7 +24,7 @@ function SettingsMigration:migrateSettings(config)
|
||||
return
|
||||
end
|
||||
|
||||
-- Fine-grained CRe margins (#4945)
|
||||
-- Fine-grained CRe margins (https://github.com/koreader/koreader/pull/4945)
|
||||
if config:has("copt_page_margins") then
|
||||
local old_margins = config:readSetting("copt_page_margins")
|
||||
logger.info("Migrating old", cfg_class, "CRe margin settings: L", old_margins[1], "T", old_margins[2], "R", old_margins[3], "B", old_margins[4])
|
||||
@@ -36,7 +36,7 @@ function SettingsMigration:migrateSettings(config)
|
||||
config:delSetting("copt_page_margins")
|
||||
end
|
||||
|
||||
-- Space condensing to Word spacing
|
||||
-- Space condensing to Word spacing (https://github.com/koreader/koreader/pull/5655)
|
||||
-- From a single number (space condensing) to a table of 2 numbers ({space width scale, space condensing}).
|
||||
-- Be conservative and don't change space width scale: use 100%
|
||||
if config:hasNot("copt_word_spacing") and config:has("copt_space_condensing") then
|
||||
|
||||
Reference in New Issue
Block a user