From a8244ddd2388c835581990605147b032aeadcad8 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Wed, 31 May 2023 15:26:13 +0300 Subject: [PATCH] FileChooser: fix legacy "Files and folders mixed" collate setting (#10514) Closes #10509. --- frontend/ui/data/onetime_migration.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/ui/data/onetime_migration.lua b/frontend/ui/data/onetime_migration.lua index a61fe82a0..73f83cd4e 100644 --- a/frontend/ui/data/onetime_migration.lua +++ b/frontend/ui/data/onetime_migration.lua @@ -7,7 +7,7 @@ local lfs = require("libs/libkoreader-lfs") local logger = require("logger") -- Date at which the last migration snippet was added -local CURRENT_MIGRATION_DATE = 20221027 +local CURRENT_MIGRATION_DATE = 20230531 -- Retrieve the date of the previous migration, if any local last_migration_date = G_reader_settings:readSetting("last_migration_date", 0) @@ -505,5 +505,14 @@ if last_migration_date < 20221027 then end end +-- 20230531, Rename `strcoll_mixed` to `strcoll`+`collate_mixed`, https://github.com/koreader/koreader/pull/10198 +if last_migration_date < 20230531 then + logger.info("Performing one-time migration for 20230531") + if G_reader_settings:readSetting("collate") == "strcoll_mixed" then + G_reader_settings:saveSetting("collate", "strcoll") + G_reader_settings:makeTrue("collate_mixed") + end +end + -- We're done, store the current migration date G_reader_settings:saveSetting("last_migration_date", CURRENT_MIGRATION_DATE)