mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
DocSettings: Fix candidates sorting (#9607)
The candidates array had a very very very high chance of being sparse, which effectively broke the logic. It was mostly harmless since said logic is only here for a long and varied history of backwards compatibility ;).
This commit is contained in:
@@ -31,14 +31,14 @@ function LuaDefaults:open(path)
|
||||
if ok and stored then
|
||||
new.rw = stored
|
||||
else
|
||||
if existing then logger.warn("Failed reading", new.file, "(probably corrupted).") end
|
||||
if existing then logger.warn("LuaDefaults: Failed reading", new.file, "(probably corrupted).") end
|
||||
-- Fallback to .old if it exists
|
||||
ok, stored = pcall(dofile, new.file..".old")
|
||||
if ok and stored then
|
||||
if existing then logger.warn("read from backup file", new.file..".old") end
|
||||
if existing then logger.warn("LuaDefaults: read from backup file", new.file..".old") end
|
||||
new.rw = stored
|
||||
else
|
||||
if existing then logger.warn("no usable backup file for", new.file, "to read from") end
|
||||
if existing then logger.warn("LuaDefaults: no usable backup file for", new.file, "to read from") end
|
||||
new.rw = {}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user