Skip to content

Commit df76bd0

Browse files
committed
OneDrive: use correct parent reference when moving files
switch the parent reference from '/root:/' to '/drive/root:/'. OneDrive seems to stop accepting the former. The other change in this commit is to convert the chunk file path correctly if the chunk is a fossil.
1 parent 065ae50 commit df76bd0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/duplicacy_oneclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func (client *OneDriveClient) MoveFile(path string, parent string) error {
456456
url := client.APIURL + "/root:/" + path
457457

458458
parentReference := make(map[string]string)
459-
parentReference["path"] = "/root:/" + parent
459+
parentReference["path"] = "/drive/root:/" + parent
460460

461461
parameters := make(map[string]interface{})
462462
parameters["parentReference"] = parentReference

src/duplicacy_onestorage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func (storage *OneDriveStorage) GetFileInfo(threadIndex int, filePath string) (e
204204

205205
// DownloadFile reads the file at 'filePath' into the chunk.
206206
func (storage *OneDriveStorage) DownloadFile(threadIndex int, filePath string, chunk *Chunk) (err error) {
207-
readCloser, _, err := storage.client.DownloadFile(storage.storageDir + "/" + filePath)
207+
readCloser, _, err := storage.client.DownloadFile(storage.storageDir + "/" + storage.convertFilePath(filePath))
208208
if err != nil {
209209
return err
210210
}

0 commit comments

Comments
 (0)