mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-15 20:26:53 +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);
|
||||
saveItem(res);
|
||||
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());
|
||||
} else {
|
||||
|
@ -449,9 +452,12 @@ final class SyncEngine
|
|||
JSONValue res = onedrive.simpleUpload(path, path);
|
||||
saveItem(res);
|
||||
string id = res["id"].str;
|
||||
string eTag = res["eTag"].str;
|
||||
string cTag = res["cTag"].str;
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue