mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-09 09:22:18 +02:00
Update sync.d
Change the handling of selfBuiltPath so correct path is used when attempting to test against 'sync_list'
This commit is contained in:
parent
c2e98ff639
commit
06061da419
20
src/sync.d
20
src/sync.d
|
@ -3276,11 +3276,11 @@ class SyncEngine {
|
||||||
// If there is a parent reference path, try and use it
|
// If there is a parent reference path, try and use it
|
||||||
string selfBuiltPath = onedriveJSONItem["parentReference"]["path"].str ~ "/" ~ onedriveJSONItem["name"].str;
|
string selfBuiltPath = onedriveJSONItem["parentReference"]["path"].str ~ "/" ~ onedriveJSONItem["name"].str;
|
||||||
|
|
||||||
// Check for and remove 'root:' prefix if present
|
// Check for ':' and split if present
|
||||||
auto indexOfRoot = selfBuiltPath.indexOf("root:");
|
auto splitIndex = selfBuiltPath.indexOf(":");
|
||||||
if (indexOfRoot != -1) {
|
if (splitIndex != -1) {
|
||||||
// Remove 'root:' and everything before it
|
// Keep only the part after ':'
|
||||||
selfBuiltPath = selfBuiltPath[indexOfRoot + 5 .. $];
|
selfBuiltPath = selfBuiltPath[splitIndex + 1 .. $];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set newItemPath to the self built path
|
// Set newItemPath to the self built path
|
||||||
|
@ -6786,11 +6786,11 @@ class SyncEngine {
|
||||||
// If there is a parent reference path, try and use it
|
// If there is a parent reference path, try and use it
|
||||||
string selfBuiltPath = onedriveJSONItem["parentReference"]["path"].str ~ "/" ~ onedriveJSONItem["name"].str;
|
string selfBuiltPath = onedriveJSONItem["parentReference"]["path"].str ~ "/" ~ onedriveJSONItem["name"].str;
|
||||||
|
|
||||||
// Check for and remove 'root:' prefix if present
|
// Check for ':' and split if present
|
||||||
auto indexOfRoot = selfBuiltPath.indexOf("root:");
|
auto splitIndex = selfBuiltPath.indexOf(":");
|
||||||
if (indexOfRoot != -1) {
|
if (splitIndex != -1) {
|
||||||
// Remove 'root:' and everything before it
|
// Keep only the part after ':'
|
||||||
selfBuiltPath = selfBuiltPath[indexOfRoot + 5 .. $];
|
selfBuiltPath = selfBuiltPath[splitIndex + 1 .. $];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set thisItemPath to the self built path
|
// Set thisItemPath to the self built path
|
||||||
|
|
Loading…
Reference in a new issue