Loading bookloresync.koplugin/booklore_settings.lua +1 −0 Original line number Diff line number Diff line Loading @@ -873,6 +873,7 @@ function Settings:exportSettings(parent) session_detection_mode = parent.session_detection_mode, progress_decimal_places = parent.progress_decimal_places, network_connect_timeout_seconds = parent.network_connect_timeout_seconds, network_connect_run_until_connect = parent.network_connect_run_until_connect, force_push_session_on_suspend = parent.force_push_session_on_suspend, connect_network_on_suspend = parent.connect_network_on_suspend, sync_mode = parent.sync_mode, Loading bookloresync.koplugin/main.lua +27 −2 Original line number Diff line number Diff line Loading @@ -473,6 +473,10 @@ function BookloreSync:init() if self.network_connect_timeout_seconds < 1 then self.network_connect_timeout_seconds = 1 end self.network_connect_run_until_connect = self.settings:readSetting("network_connect_run_until_connect") if self.network_connect_run_until_connect == nil then self.network_connect_run_until_connect = false end self.manual_sync_only = false self.force_push_session_on_suspend = false self.connect_network_on_suspend = false Loading Loading @@ -3875,11 +3879,27 @@ function BookloreSync:addToMainMenu(menu_items) 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."), enabled_func = function() return not self.network_connect_run_until_connect end, keep_menu_open = true, callback = function() Settings:configureNetworkConnectTimeout(self) end, }, { text = _("Run until connect"), help_text = _("Disable plugin-side connect timeout and wait until WiFi connects or the underlying network stack times out on its own."), checked_func = function() return self.network_connect_run_until_connect end, keep_menu_open = true, callback = function() self.network_connect_run_until_connect = not self.network_connect_run_until_connect self.settings:saveSetting("network_connect_run_until_connect", self.network_connect_run_until_connect) self.settings:flush() end, }, { text = _("Automatic (sync on suspend + WiFi)"), help_text = _("Automatically sync sessions when device suspends. Enables WiFi and attempts connection before syncing."), Loading Loading @@ -7016,10 +7036,11 @@ function BookloreSync:connectNetwork() if timeout < 1 then timeout = 1 end local run_until_connect = self.network_connect_run_until_connect == true local elapsed = 0 local check_interval = 0.5 while elapsed < timeout do while run_until_connect or elapsed < timeout do if isNetworkConnected() then self:logInfo("BookloreSync: Network connected successfully after", elapsed, "seconds") return true Loading @@ -7045,7 +7066,11 @@ function BookloreSync:connectNetwork() elapsed = elapsed + check_interval end if run_until_connect then self:logWarn("BookloreSync: Network connect wait ended before connection was established") else self:logWarn("BookloreSync: Network connection timeout after", timeout, "seconds") end return false end Loading Loading
bookloresync.koplugin/booklore_settings.lua +1 −0 Original line number Diff line number Diff line Loading @@ -873,6 +873,7 @@ function Settings:exportSettings(parent) session_detection_mode = parent.session_detection_mode, progress_decimal_places = parent.progress_decimal_places, network_connect_timeout_seconds = parent.network_connect_timeout_seconds, network_connect_run_until_connect = parent.network_connect_run_until_connect, force_push_session_on_suspend = parent.force_push_session_on_suspend, connect_network_on_suspend = parent.connect_network_on_suspend, sync_mode = parent.sync_mode, Loading
bookloresync.koplugin/main.lua +27 −2 Original line number Diff line number Diff line Loading @@ -473,6 +473,10 @@ function BookloreSync:init() if self.network_connect_timeout_seconds < 1 then self.network_connect_timeout_seconds = 1 end self.network_connect_run_until_connect = self.settings:readSetting("network_connect_run_until_connect") if self.network_connect_run_until_connect == nil then self.network_connect_run_until_connect = false end self.manual_sync_only = false self.force_push_session_on_suspend = false self.connect_network_on_suspend = false Loading Loading @@ -3875,11 +3879,27 @@ function BookloreSync:addToMainMenu(menu_items) 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."), enabled_func = function() return not self.network_connect_run_until_connect end, keep_menu_open = true, callback = function() Settings:configureNetworkConnectTimeout(self) end, }, { text = _("Run until connect"), help_text = _("Disable plugin-side connect timeout and wait until WiFi connects or the underlying network stack times out on its own."), checked_func = function() return self.network_connect_run_until_connect end, keep_menu_open = true, callback = function() self.network_connect_run_until_connect = not self.network_connect_run_until_connect self.settings:saveSetting("network_connect_run_until_connect", self.network_connect_run_until_connect) self.settings:flush() end, }, { text = _("Automatic (sync on suspend + WiFi)"), help_text = _("Automatically sync sessions when device suspends. Enables WiFi and attempts connection before syncing."), Loading Loading @@ -7016,10 +7036,11 @@ function BookloreSync:connectNetwork() if timeout < 1 then timeout = 1 end local run_until_connect = self.network_connect_run_until_connect == true local elapsed = 0 local check_interval = 0.5 while elapsed < timeout do while run_until_connect or elapsed < timeout do if isNetworkConnected() then self:logInfo("BookloreSync: Network connected successfully after", elapsed, "seconds") return true Loading @@ -7045,7 +7066,11 @@ function BookloreSync:connectNetwork() elapsed = elapsed + check_interval end if run_until_connect then self:logWarn("BookloreSync: Network connect wait ended before connection was established") else self:logWarn("BookloreSync: Network connection timeout after", timeout, "seconds") end return false end Loading