mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-16 12:45:14 +02:00
Add progress logging for large uploads
* Add progress logging for large uploads in non verbose mode
This commit is contained in:
parent
6daa637ff2
commit
27b89a4922
|
@ -631,11 +631,11 @@ final class SyncEngine
|
|||
private void downloadFileItem(Item item, string path)
|
||||
{
|
||||
assert(item.type == ItemType.file);
|
||||
write("Downloading ", path, "...");
|
||||
write("Downloading ", path, " ...");
|
||||
onedrive.downloadById(item.driveId, item.id, path);
|
||||
setTimes(path, item.mtime, item.mtime);
|
||||
writeln(" done.");
|
||||
log.fileOnly("Downloading ", path, "... done.");
|
||||
log.fileOnly("Downloading ", path, " ... done.");
|
||||
}
|
||||
|
||||
// returns true if the given item corresponds to the local one
|
||||
|
|
|
@ -91,6 +91,7 @@ struct UploadSession
|
|||
JSONValue response;
|
||||
while (true) {
|
||||
long fragSize = fragmentSize < fileSize - offset ? fragmentSize : fileSize - offset;
|
||||
log.log("Upload Progress: ", double(offset)/fileSize*100,"%");
|
||||
log.vlog("Uploading fragment: ", offset, "-", offset + fragSize, "/", fileSize);
|
||||
response = onedrive.uploadFragment(
|
||||
session["uploadUrl"].str,
|
||||
|
@ -107,6 +108,7 @@ struct UploadSession
|
|||
save();
|
||||
}
|
||||
// upload complete
|
||||
log.log("Upload Progress: ", double(offset)/fileSize*100,"%");
|
||||
remove(sessionFilePath);
|
||||
return response;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue