🎨 Support downloading cloud data snapshots to local on demand https://github.com/siyuan-note/siyuan/issues/8057

This commit is contained in:
Liang Ding 2023-04-21 21:31:44 +08:00
parent 171fc40dea
commit 3f6421cf17
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 11 additions and 6 deletions

View file

@ -588,7 +588,14 @@ func DownloadCloudSnapshot(tag, id string) (err error) {
}
defer util.PushClearProgress()
downloadFileCount, downloadChunkCount, downloadBytes, err := repo.DownloadTagIndex(tag, id, map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
var downloadFileCount, downloadChunkCount int
var downloadBytes int64
if "" == tag {
downloadFileCount, downloadChunkCount, downloadBytes, err = repo.DownloadIndex(id, map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
} else {
downloadFileCount, downloadChunkCount, downloadBytes, err = repo.DownloadTagIndex(tag, id, map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
}
if nil != err {
return
}