mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-23 16:12:12 +02:00
* Update database enforce check with conditional check on parent drive ID. If the parent is a shared folder, the parent ID will never be in the database as we are never provided that parent ID.
This commit is contained in:
parent
503f360c87
commit
2529b99265
12
src/sync.d
12
src/sync.d
|
@ -2990,11 +2990,17 @@ final class SyncEngine
|
|||
// Perform the database lookup - is the parent in the database?
|
||||
if (!itemdb.selectByPath(dirName(path), parent.driveId, parent)) {
|
||||
// parent is not in the database
|
||||
log.vdebug("Parent path is not in the database - need to add it");
|
||||
log.vdebug("Parent path is not in the database - need to add it: ", dirName(path));
|
||||
uploadCreateDir(dirName(path));
|
||||
}
|
||||
// still enforce check of parent path. if the above was triggered, the below will generate a sync retry and will now be sucessful
|
||||
enforce(itemdb.selectByPath(dirName(path), parent.driveId, parent), "The parent item id is not in the database");
|
||||
|
||||
// Is the parent a 'folder' from another user? ie - is this a 'shared folder' that has been shared with us?
|
||||
if (defaultDriveId == parent.driveId){
|
||||
// enforce check of parent path. if the above was triggered, the below will generate a sync retry and will now be sucessful
|
||||
enforce(itemdb.selectByPath(dirName(path), parent.driveId, parent), "The parent item id is not in the database");
|
||||
} else {
|
||||
log.vdebug("Parent drive ID is not our drive ID - parent most likely a shared folder");
|
||||
}
|
||||
|
||||
JSONValue driveItem = [
|
||||
"name": JSONValue(baseName(path)),
|
||||
|
|
Loading…
Reference in a new issue