mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-27 18:00:36 +02:00
Resolve issue #73 - OneDrive Error 507 Insufficient Storage Exception
* Resolve https://github.com/skilion/onedrive/issues/73 by by tracking the change in available free disk space when uploading a new file to OneDrive
This commit is contained in:
parent
82ef982240
commit
7a394a065f
10
src/sync.d
10
src/sync.d
|
@ -792,9 +792,19 @@ final class SyncEngine
|
||||||
uploadNewItems(entry.name);
|
uploadNewItems(entry.name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// This item is a file
|
||||||
|
// Can we upload this file - is there enough free space? - https://github.com/skilion/onedrive/issues/73
|
||||||
|
auto fileSize = getSize(path);
|
||||||
|
if ((remainingFreeSpace - fileSize) > 0){
|
||||||
Item item;
|
Item item;
|
||||||
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
|
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
|
||||||
uploadNewFile(path);
|
uploadNewFile(path);
|
||||||
|
remainingFreeSpace = (remainingFreeSpace - fileSize);
|
||||||
|
log.vlog("Remaining free space: ", remainingFreeSpace);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Not enough free space
|
||||||
|
log.log("Skipping item '", path, "' due to insufficient free space available on OneDrive");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue