Merge branch 'master' of bitbucket.org:skilion/onedrive-free-client

This commit is contained in:
skilion 2018-01-19 17:53:45 +01:00
commit 099522dd0e
2 changed files with 10 additions and 4 deletions

View file

@ -133,7 +133,10 @@ If you encounter any bugs you can report them here on Github. Before filing an i
1. Check the version of the application you are using `onedrive --version`
2. Run the application in verbose mode `onedrive --verbose`
3. Have the log of the error (preferably uploaded on an external website such as [pastebin](https://pastebin.com/))
4. Collect any information that you may think it is relevant to the error (such as the steps to trigger it)
4. Collect any information that you may think it is relevant to the error
- The steps to trigger the error
- What have you already done to try solve it
- ...
### All available commands:
```text

View file

@ -154,6 +154,7 @@ final class SyncEngine
// download the new changes of a specific item
// id is the root of the drive or a shared folder
private void applyDifferences(string driveId, const(char)[] id)
{
JSONValue changes;
@ -172,7 +173,8 @@ final class SyncEngine
}
}
foreach (item; changes["value"].array) {
applyDifference(item, driveId);
bool isRoot = (id == item["id"].str); // fix for https://github.com/skilion/onedrive/issues/269
applyDifference(item, driveId, isRoot);
}
// the response may contain either @odata.deltaLink or @odata.nextLink
@ -189,13 +191,14 @@ final class SyncEngine
}
// process the change of a single DriveItem
private void applyDifference(JSONValue driveItem, string driveId)
private void applyDifference(JSONValue driveItem, string driveId, bool isRoot)
{
Item item = makeItem(driveItem);
log.vlog("Processing ", item.id, " ", item.name);
if (isItemRoot(driveItem) || !item.parentId) {
if (isItemRoot(driveItem) || !item.parentId || isRoot) {
log.vlog("Root");
item.parentId = null; // ensures that it has no parent
item.driveId = driveId; // HACK: makeItem() cannot set the driveId propery of the root
itemdb.upsert(item);
return;