@@ -3862,6 +3870,16 @@ function BookloreSync:addToMainMenu(menu_items)
text = _("Sync Mode"),
help_text = _("Choose between automatic syncing and manual queue-only mode."),
sub_item_table = {
{
text_func = function()
return T(_("WiFi connect timeout (seconds) (%1)"), tostring(self.network_connect_timeout_seconds or DEFAULT_NETWORK_CONNECT_TIMEOUT_SECONDS))
end,
help_text = _("How long to wait for WiFi to become connected after enabling it, before giving up. Increase this on slower devices."),
keep_menu_open = true,
callback = function()
Settings:configureNetworkConnectTimeout(self)
end,
},
{
text = _("Automatic (sync on suspend + WiFi)"),
help_text = _("Automatically sync sessions when device suspends. Enables WiFi and attempts connection before syncing."),
@@ -4573,7 +4591,7 @@ function BookloreSync:addToMainMenu(menu_items)
},
{
text = _("Clear Cache"),
help_text = _("Delete all cached book hashes and file path mappings. This will not affect pending sessions. The cache will be rebuilt as you read."),
help_text = _("Delete cached book hashes and file path mappings. Entries still referenced by pending annotations/ratings/bookmarks are retained to preserve queued sync data."),
enabled_func = function()
if not self.db then
return false
@@ -4583,11 +4601,18 @@ function BookloreSync:addToMainMenu(menu_items)
end,
callback = function()
if self.db then
self.db:clearBookCache()
local ok = self.db:clearBookCache()
if ok then
UIManager:show(InfoMessage:new{
text = _("Local book cache cleared"),
timeout = 2,
})
else
UIManager:show(InfoMessage:new{
text = _("Failed to clear local book cache"),
timeout = 3,
})
end
end
end,
},
@@ -6987,7 +7012,10 @@ function BookloreSync:connectNetwork()
local ok_ffi, ffiutil = pcall(require, "ffi/util")
local sleep_available = ok_ffi and ffiutil and type(ffiutil.sleep) == "function"
local timeout = 15
local timeout = tonumber(self.network_connect_timeout_seconds) or DEFAULT_NETWORK_CONNECT_TIMEOUT_SECONDS