mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-19 22:26:37 +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;
|
private string[2][] idsToDelete;
|
||||||
// default drive id
|
// default drive id
|
||||||
private string defaultDriveId;
|
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)
|
this(Config cfg, OneDriveApi onedrive, ItemDatabase itemdb, SelectiveSync selectiveSync)
|
||||||
{
|
{
|
||||||
|
@ -140,6 +146,19 @@ final class SyncEngine
|
||||||
|
|
||||||
void init()
|
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
|
// check if there is an interrupted upload session
|
||||||
if (session.restore()) {
|
if (session.restore()) {
|
||||||
log.log("Continuing the upload session ...");
|
log.log("Continuing the upload session ...");
|
||||||
|
|
Loading…
Reference in a new issue