[feat] Synchronize local folder with dropbox (#5591)

Option to synchronize files in local koreader folder with folder on Dropbox. All files that aren't on the local disk will be downloaded. Files with different sizes will also be downloaded and overwritten.
The download process can be paused or stopped at any time (similar to downloading images in Wikipedia).

Synchronize and settings are available after long press in dropbox account in Cloud storage.
Limitations: Only one folder (without subfolders) can be synchronize with one folder on local storage.
This commit is contained in:
Robert
2019-11-18 18:39:45 +01:00
committed by Frans de Jonge
parent 16fd731f73
commit 04741d8cfd
4 changed files with 349 additions and 31 deletions

View File

@@ -10,8 +10,12 @@ local _ = require("gettext")
local DropBox = {}
function DropBox:run(url, password)
return DropBoxApi:listFolder(url, password)
function DropBox:run(url, password, choose_folder_mode)
return DropBoxApi:listFolder(url, password, choose_folder_mode)
end
function DropBox:showFiles(url, password)
return DropBoxApi:showFiles(url, password)
end
function DropBox:downloadFile(item, password, path, close)
@@ -39,6 +43,15 @@ function DropBox:downloadFile(item, password, path, close)
end
end
function DropBox:downloadFileNoUI(url, password, path)
local code_response = DropBoxApi:downloadFile(url, password, path)
if code_response == 200 then
return true
else
return false
end
end
function DropBox:config(item, callback)
local text_info = "How to generate Access Token:\n"..
"1. Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps.\n"..