Differenciate between OneNote objects and other unsupported objects (#870)

* Differenciate between OneNote objects and other unsupported objects
This commit is contained in:
abraunegg 2020-04-15 14:54:21 +10:00 committed by GitHub
parent d3aa0032bc
commit 2a7e48b823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1353,6 +1353,7 @@ final class SyncEngine
}
// check the item type
string path;
if (!unwanted) {
if (isItemFile(driveItem)) {
log.vdebug("The item we are syncing is a file");
@ -1362,14 +1363,22 @@ final class SyncEngine
log.vdebug("The item we are syncing is a remote item");
assert(isItemFolder(driveItem["remoteItem"]), "The remote item is not a folder");
} else {
log.vlog("This item type (", item.name, ") is not supported");
// Why was this unwanted?
path = itemdb.computePath(item.driveId, item.parentId) ~ "/" ~ item.name;
// Microsoft OneNote container objects present as neither folder or file but has file size
if ((!isItemFile(driveItem)) && (!isItemFolder(driveItem)) && (hasFileSize(driveItem))) {
// Log that this was skipped as this was a Microsoft OneNote item and unsupported
log.vlog("The Microsoft OneNote Notebook '", path, "' is not supported by this client");
} else {
// Log that this item was skipped as unsupported
log.vlog("The OneDrive item '", path, "' is not supported by this client");
}
unwanted = true;
log.vdebug("Flagging as unwanted: item type is not supported");
}
}
// check for selective sync
string path;
if (!unwanted) {
// Is the item parent in the local database?
if (itemdb.idInLocalDatabase(item.driveId, item.parentId)){