mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +01:00
🎨 支持多设备操作不同文档后云端同步合并 https://github.com/siyuan-note/siyuan/issues/5092
This commit is contained in:
parent
ed82886eb0
commit
25990a53f8
2 changed files with 23 additions and 23 deletions
|
|
@ -320,7 +320,7 @@ func ossDownload0(localDirPath, cloudDirPath, fetch string, fetchedFiles *int, t
|
|||
return
|
||||
}
|
||||
|
||||
func ossUpload(localDirPath, cloudDirPath, cloudDevice string, boot bool, removedSyncList, upsertedSyncList map[string]bool) (wroteFiles int, transferSize uint64, err error) {
|
||||
func ossUpload(localDirPath, cloudDirPath, cloudDevice string, boot bool, removeList, upsertList map[string]bool) (wroteFiles int, transferSize uint64, err error) {
|
||||
if !gulu.File.IsExist(localDirPath) {
|
||||
return
|
||||
}
|
||||
|
|
@ -328,16 +328,16 @@ func ossUpload(localDirPath, cloudDirPath, cloudDevice string, boot bool, remove
|
|||
localDevice := Conf.System.ID
|
||||
excludes := getSyncExcludedList(localDirPath)
|
||||
localFileList, genIndexErr := genCloudIndex(localDirPath, excludes)
|
||||
if nil != genIndexErr {
|
||||
err = genIndexErr
|
||||
return
|
||||
}
|
||||
|
||||
var localUpserts, cloudRemoves []string
|
||||
var cloudFileList map[string]*CloudIndex
|
||||
if "" != localDevice && localDevice == cloudDevice {
|
||||
//util.LogInfof("cloud device is the same as local device, get index from local")
|
||||
if nil == genIndexErr {
|
||||
localUpserts, cloudRemoves, err = cloudUpsertRemoveLocalListOSS(localDirPath, removedSyncList, upsertedSyncList, excludes)
|
||||
} else {
|
||||
util.LogInfof("get local index failed [%s], get index from cloud", err)
|
||||
cloudFileList, err = getCloudFileListOSS(cloudDirPath)
|
||||
}
|
||||
localUpserts, cloudRemoves, err = cloudUpsertRemoveLocalListOSS(localDirPath, removeList, upsertList, excludes)
|
||||
} else {
|
||||
cloudFileList, err = getCloudFileListOSS(cloudDirPath)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue