mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +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
18
src/sync.d
18
src/sync.d
|
@ -792,10 +792,20 @@ final class SyncEngine
|
|||
uploadNewItems(entry.name);
|
||||
}
|
||||
} else {
|
||||
Item item;
|
||||
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
|
||||
uploadNewFile(path);
|
||||
}
|
||||
// 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;
|
||||
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
|
||||
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 {
|
||||
// This path was skipped - why?
|
||||
|
|
Loading…
Reference in a new issue