mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Fix path calculation for Client Side Filtering evaluations for Personal Accounts (#3111)
* Use original method for Personal Accounts, use new method for Business and SharePoint
This commit is contained in:
parent
96a3c2d7c9
commit
768846a5dd
1 changed files with 25 additions and 18 deletions
43
src/sync.d
43
src/sync.d
|
|
@ -1922,25 +1922,32 @@ class SyncEngine {
|
|||
// Calculate this items path
|
||||
computedItemPath = computeItemPath(thisItemDriveId, thisItemParentId);
|
||||
|
||||
// is 'thisItemParentId' in the DB as a 'root' object?
|
||||
Item databaseItem;
|
||||
|
||||
// Is this a remote drive?
|
||||
if (thisItemDriveId != appConfig.defaultDriveId) {
|
||||
// query the database for the actual thisItemParentId record
|
||||
itemDB.selectById(thisItemDriveId, thisItemParentId, databaseItem);
|
||||
}
|
||||
|
||||
// calculate newItemPath
|
||||
if (databaseItem.type == ItemType.root) {
|
||||
// if the record type is now a root record, we dont want to add the name to itself
|
||||
newItemPath = computedItemPath;
|
||||
// set this for later use
|
||||
rootSharedFolder = true;
|
||||
// Use the original method of calculation for Personal Accounts
|
||||
if (appConfig.accountType == "personal") {
|
||||
// Calculate this items path
|
||||
newItemPath = computeItemPath(thisItemDriveId, thisItemParentId) ~ "/" ~ thisItemName;
|
||||
} else {
|
||||
// add the item name to the computed path
|
||||
newItemPath = computedItemPath ~ "/" ~ thisItemName;
|
||||
}
|
||||
// Business Accounts
|
||||
// is 'thisItemParentId' in the DB as a 'root' object?
|
||||
Item databaseItem;
|
||||
|
||||
// Is this a remote drive?
|
||||
if (thisItemDriveId != appConfig.defaultDriveId) {
|
||||
// query the database for the actual thisItemParentId record
|
||||
itemDB.selectById(thisItemDriveId, thisItemParentId, databaseItem);
|
||||
}
|
||||
|
||||
// calculate newItemPath
|
||||
if (databaseItem.type == ItemType.root) {
|
||||
// if the record type is now a root record, we dont want to add the name to itself
|
||||
newItemPath = computedItemPath;
|
||||
// set this for later use
|
||||
rootSharedFolder = true;
|
||||
} else {
|
||||
// add the item name to the computed path
|
||||
newItemPath = computedItemPath ~ "/" ~ thisItemName;
|
||||
}
|
||||
}
|
||||
|
||||
// debug logging of what was calculated
|
||||
if (debugLogging) {addLogEntry("JSON Item calculated full path is: " ~ newItemPath, ["debug"]);}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue