1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

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.
This commit is contained in:
Gilbert Chen
2025-05-02 15:30:48 -04:00
parent 065ae50868
commit df76bd0a34
2 changed files with 2 additions and 2 deletions

View File

@@ -456,7 +456,7 @@ func (client *OneDriveClient) MoveFile(path string, parent string) error {
url := client.APIURL + "/root:/" + path url := client.APIURL + "/root:/" + path
parentReference := make(map[string]string) parentReference := make(map[string]string)
parentReference["path"] = "/root:/" + parent parentReference["path"] = "/drive/root:/" + parent
parameters := make(map[string]interface{}) parameters := make(map[string]interface{})
parameters["parentReference"] = parentReference parameters["parentReference"] = parentReference

View File

@@ -204,7 +204,7 @@ func (storage *OneDriveStorage) GetFileInfo(threadIndex int, filePath string) (e
// DownloadFile reads the file at 'filePath' into the chunk. // DownloadFile reads the file at 'filePath' into the chunk.
func (storage *OneDriveStorage) DownloadFile(threadIndex int, filePath string, chunk *Chunk) (err error) { func (storage *OneDriveStorage) DownloadFile(threadIndex int, filePath string, chunk *Chunk) (err error) {
readCloser, _, err := storage.client.DownloadFile(storage.storageDir + "/" + filePath) readCloser, _, err := storage.client.DownloadFile(storage.storageDir + "/" + storage.convertFilePath(filePath))
if err != nil { if err != nil {
return err return err
} }