diff --git a/src/sync.d b/src/sync.d index 6cc5c11c..91b26bb2 100644 --- a/src/sync.d +++ b/src/sync.d @@ -6452,13 +6452,23 @@ class SyncEngine { targetItemId = changedItemId; } } - + // Fetch the details from cachedOnlineDriveData if this is available // - cachedOnlineDriveData.quotaRestricted; // - cachedOnlineDriveData.quotaAvailable; // - cachedOnlineDriveData.quotaRemaining; DriveDetailsCache cachedOnlineDriveData; + // Make sure that parentItem.driveId is in our driveIDs array to use when checking if item is in database + // Keep the DriveDetailsCache array with unique entries only + if (!canFindDriveId(targetDriveId, cachedOnlineDriveData)) { + // Add this driveId to the drive cache, which then also sets for the defaultDriveId: + // - quotaRestricted; + // - quotaAvailable; + // - quotaRemaining; + addOrUpdateOneDriveOnlineDetails(targetDriveId); + } + // Query the details using the correct 'targetDriveId' for this modified file to be uploaded cachedOnlineDriveData = getDriveDetails(targetDriveId);