mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-21 15:16:36 +02:00
* Update how and when filesize is configured and used before file download
This commit is contained in:
parent
97ee66e9c0
commit
10dd0300e3
17
src/sync.d
17
src/sync.d
|
@ -1107,10 +1107,6 @@ final class SyncEngine
|
||||||
if (e.httpStatusCode >= 500) {
|
if (e.httpStatusCode >= 500) {
|
||||||
// OneDrive returned a 'HTTP 5xx Server Side Error' - gracefully handling error - error message already logged
|
// OneDrive returned a 'HTTP 5xx Server Side Error' - gracefully handling error - error message already logged
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
// Default operation if not a 500 error
|
|
||||||
log.error("ERROR: Query of OneDrive for file details failed");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1122,9 +1118,18 @@ final class SyncEngine
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fileSize = fileDetails["size"].integer;
|
|
||||||
|
|
||||||
if (!dryRun) {
|
if (!dryRun) {
|
||||||
|
ulong fileSize = 0;
|
||||||
|
if (hasFileSize(fileDetails)) {
|
||||||
|
// Set the file size from the returned data
|
||||||
|
fileSize = fileDetails["size"].integer;
|
||||||
|
} else {
|
||||||
|
// Issue #540 handling
|
||||||
|
log.vdebug("ERROR: onedrive.getFileDetails call returned a OneDriveException error");
|
||||||
|
// We want to return, cant download
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
onedrive.downloadById(item.driveId, item.id, path, fileSize);
|
onedrive.downloadById(item.driveId, item.id, path, fileSize);
|
||||||
} catch (OneDriveException e) {
|
} catch (OneDriveException e) {
|
||||||
|
|
Loading…
Reference in a new issue