mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-01 21:52:50 +02:00
Configure at sync.init() global variables for driveId, rootId, accountType & space available
* Configure at sync.init() global variables for driveId, rootId, accountType & space available
This commit is contained in:
parent
134c14e459
commit
82ef982240
19
src/sync.d
19
src/sync.d
|
@ -127,6 +127,12 @@ final class SyncEngine
|
|||
private string[2][] idsToDelete;
|
||||
// default drive id
|
||||
private string defaultDriveId;
|
||||
// default root id
|
||||
private string defaultRootId;
|
||||
// type of OneDrive account
|
||||
private string accountType;
|
||||
// free space remaining at init()
|
||||
private long remainingFreeSpace;
|
||||
|
||||
this(Config cfg, OneDriveApi onedrive, ItemDatabase itemdb, SelectiveSync selectiveSync)
|
||||
{
|
||||
|
@ -140,6 +146,19 @@ final class SyncEngine
|
|||
|
||||
void init()
|
||||
{
|
||||
// Set accountType, defaultDriveId, defaultRootId & remainingFreeSpace once and reuse where possible
|
||||
auto oneDriveDetails = onedrive.getDefaultDrive();
|
||||
accountType = oneDriveDetails["driveType"].str;
|
||||
defaultDriveId = oneDriveDetails["id"].str;
|
||||
defaultRootId = onedrive.getDefaultRoot["id"].str;
|
||||
remainingFreeSpace = oneDriveDetails["quota"]["remaining"].integer;
|
||||
|
||||
// Display accountType, defaultDriveId, defaultRootId & remainingFreeSpace for verbose logging purposes
|
||||
log.vlog("Account Type: ", accountType);
|
||||
log.vlog("Default Drive ID: ", defaultDriveId);
|
||||
log.vlog("Default Root ID: ", defaultRootId);
|
||||
log.vlog("Remaining Free Space: ", remainingFreeSpace);
|
||||
|
||||
// check if there is an interrupted upload session
|
||||
if (session.restore()) {
|
||||
log.log("Continuing the upload session ...");
|
||||
|
|
Loading…
Reference in a new issue