mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-15 20:26:53 +02:00
hack for onedrive biz
This commit is contained in:
parent
3529a4f78b
commit
126f2719b8
|
@ -36,6 +36,9 @@ private bool isItemRemote(const ref JSONValue item)
|
||||||
return ("remoteItem" in item) != null;
|
return ("remoteItem" in item) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HACK: OneDrive Biz does not return parentReference for the root
|
||||||
|
string defaultDriveId;
|
||||||
|
|
||||||
private Item makeItem(const ref JSONValue jsonItem)
|
private Item makeItem(const ref JSONValue jsonItem)
|
||||||
{
|
{
|
||||||
ItemType type;
|
ItemType type;
|
||||||
|
@ -48,7 +51,7 @@ private Item makeItem(const ref JSONValue jsonItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
Item item = {
|
Item item = {
|
||||||
driveId: jsonItem["parentReference"]["driveId"].str,
|
driveId: isItemRoot(jsonItem) ? defaultDriveId : jsonItem["parentReference"]["driveId"].str,
|
||||||
id: jsonItem["id"].str,
|
id: jsonItem["id"].str,
|
||||||
name: jsonItem["name"].str,
|
name: jsonItem["name"].str,
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -147,6 +150,7 @@ final class SyncEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
defaultDriveId = onedrive.getDefaultDrive()["id"].str;
|
||||||
JSONValue changes;
|
JSONValue changes;
|
||||||
do {
|
do {
|
||||||
// get changes from the server
|
// get changes from the server
|
||||||
|
|
Loading…
Reference in a new issue