🎨 支持多设备操作不同文档后云端同步合并 https://github.com/siyuan-note/siyuan/issues/5092

This commit is contained in:
Liang Ding 2022-06-05 16:57:42 +08:00
parent ed82886eb0
commit 25990a53f8
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 23 additions and 23 deletions

View file

@ -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)
}