mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-16 20:56:44 +02:00
Fix 'Key not found: name' when computing skip_dir path (#701)
* OneDrive API difference between Personal & Business where some Business accounts do not send 'name' key with parent reference. Check for existance of 'name' key before use.
This commit is contained in:
parent
585b35724f
commit
e99872eaa2
|
@ -1117,7 +1117,13 @@ final class SyncEngine
|
|||
// we need to workout the FULL path for this item
|
||||
string parentDriveId = driveItem["parentReference"]["driveId"].str;
|
||||
string parentItem = driveItem["parentReference"]["id"].str;
|
||||
simplePathToCheck = driveItem["parentReference"]["name"].str ~ "/" ~ driveItem["name"].str;
|
||||
// simple path
|
||||
if (("name" in driveItem["parentReference"]) != null) {
|
||||
simplePathToCheck = driveItem["parentReference"]["name"].str ~ "/" ~ driveItem["name"].str;
|
||||
} else {
|
||||
simplePathToCheck = driveItem["name"].str;
|
||||
}
|
||||
// complex path
|
||||
complexPathToCheck = itemdb.computePath(parentDriveId, parentItem) ~ "/" ~ driveItem["name"].str;
|
||||
complexPathToCheck = buildNormalizedPath(complexPathToCheck);
|
||||
log.vdebug("skip_dir path to check (simple): ", simplePathToCheck);
|
||||
|
|
Loading…
Reference in a new issue