mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-29 10:50:30 +02:00
parent
8eef9e1f96
commit
c2e98ff639
24
src/sync.d
24
src/sync.d
|
@ -3275,8 +3275,16 @@ class SyncEngine {
|
||||||
if (("path" in onedriveJSONItem["parentReference"]) != null) {
|
if (("path" in onedriveJSONItem["parentReference"]) != null) {
|
||||||
// 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;
|
||||||
auto splitPath = selfBuiltPath.split("root:");
|
|
||||||
newItemPath = splitPath[1];
|
// Check for and remove 'root:' prefix if present
|
||||||
|
auto indexOfRoot = selfBuiltPath.indexOf("root:");
|
||||||
|
if (indexOfRoot != -1) {
|
||||||
|
// Remove 'root:' and everything before it
|
||||||
|
selfBuiltPath = selfBuiltPath[indexOfRoot + 5 .. $];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set newItemPath to the self built path
|
||||||
|
newItemPath = selfBuiltPath;
|
||||||
} else {
|
} else {
|
||||||
// no parent reference path available
|
// no parent reference path available
|
||||||
newItemPath = thisItemName;
|
newItemPath = thisItemName;
|
||||||
|
@ -6777,8 +6785,16 @@ class SyncEngine {
|
||||||
if (("path" in onedriveJSONItem["parentReference"]) != null) {
|
if (("path" in onedriveJSONItem["parentReference"]) != null) {
|
||||||
// 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;
|
||||||
auto splitPath = selfBuiltPath.split("root:");
|
|
||||||
thisItemPath = splitPath[1];
|
// Check for and remove 'root:' prefix if present
|
||||||
|
auto indexOfRoot = selfBuiltPath.indexOf("root:");
|
||||||
|
if (indexOfRoot != -1) {
|
||||||
|
// Remove 'root:' and everything before it
|
||||||
|
selfBuiltPath = selfBuiltPath[indexOfRoot + 5 .. $];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set thisItemPath to the self built path
|
||||||
|
thisItemPath = selfBuiltPath;
|
||||||
} else {
|
} else {
|
||||||
// no parent reference path available
|
// no parent reference path available
|
||||||
thisItemPath = onedriveJSONItem["name"].str;
|
thisItemPath = onedriveJSONItem["name"].str;
|
||||||
|
|
Loading…
Reference in a new issue