mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-04 06:52:18 +02:00
fix Precondition Failed after upload
This commit is contained in:
parent
7ea7c0f9cd
commit
c74282879b
12
src/sync.d
12
src/sync.d
|
@ -394,7 +394,10 @@ final class SyncEngine
|
||||||
auto res = onedrive.simpleUpload(path, path, item.eTag);
|
auto res = onedrive.simpleUpload(path, path, item.eTag);
|
||||||
saveItem(res);
|
saveItem(res);
|
||||||
id = res["id"].str;
|
id = res["id"].str;
|
||||||
eTag = res["eTag"].str;
|
/* use the cTag instead of the eTag because Onedrive changes the
|
||||||
|
* metadata of some type of files (ex. images) AFTER they have been
|
||||||
|
* uploaded */
|
||||||
|
eTag = res["cTag"].str;
|
||||||
}
|
}
|
||||||
uploadLastModifiedTime(id, eTag, localModifiedTime.toUTC());
|
uploadLastModifiedTime(id, eTag, localModifiedTime.toUTC());
|
||||||
} else {
|
} else {
|
||||||
|
@ -449,9 +452,12 @@ final class SyncEngine
|
||||||
JSONValue res = onedrive.simpleUpload(path, path);
|
JSONValue res = onedrive.simpleUpload(path, path);
|
||||||
saveItem(res);
|
saveItem(res);
|
||||||
string id = res["id"].str;
|
string id = res["id"].str;
|
||||||
string eTag = res["eTag"].str;
|
string cTag = res["cTag"].str;
|
||||||
SysTime mtime = timeLastModified(path).toUTC();
|
SysTime mtime = timeLastModified(path).toUTC();
|
||||||
uploadLastModifiedTime(id, eTag, mtime);
|
/* use the cTag instead of the eTag because Onedrive changes the
|
||||||
|
* metadata of some type of files (ex. images) AFTER they have been
|
||||||
|
* uploaded */
|
||||||
|
uploadLastModifiedTime(id, cTag, mtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void uploadDeleteItem(Item item, const(char)[] path)
|
private void uploadDeleteItem(Item item, const(char)[] path)
|
||||||
|
|
Loading…
Reference in a new issue