mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[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:
@@ -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"..
|
||||
|
||||
Reference in New Issue
Block a user