mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
SyncService: Only require online connectivity when using Dropbox (#12520)
Aligns with the CloudStorage behavior. Fix #12518
This commit is contained in:
@@ -122,9 +122,17 @@ end
|
||||
-- and renamed to replace the old cached file (thus the naming). The cached file stays (in the same folder) till being replaced
|
||||
-- in the next round.
|
||||
function SyncService.sync(server, file_path, sync_cb, is_silent)
|
||||
if NetworkMgr:willRerunWhenOnline(function() SyncService.sync(server, file_path, sync_cb, is_silent) end) then
|
||||
return
|
||||
if server.type == "dropbox" then
|
||||
if NetworkMgr:willRerunWhenOnline(function() SyncService.sync(server, file_path, sync_cb, is_silent) end) then
|
||||
return
|
||||
end
|
||||
else
|
||||
-- NOTE: Align behavior with CloudStorage:openCloudServer, where only Dropbox requires isOnline
|
||||
if NetworkMgr:willRerunWhenConnected(function() SyncService.sync(server, file_path, sync_cb, is_silent) end) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local file_name = ffiutil.basename(file_path)
|
||||
local income_file_path = file_path .. ".temp" -- file downloaded from server
|
||||
local cached_file_path = file_path .. ".sync" -- file uploaded to server last time
|
||||
|
||||
Reference in New Issue
Block a user