Skip to content

Commit

Permalink
Update PR
Browse files Browse the repository at this point in the history
* Ensure 'skip_dir' rules are correctly applied to remote shared folder links
  • Loading branch information
abraunegg committed Dec 29, 2024
1 parent bf50d8d commit cbd9127
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/sync.d
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,9 @@ class SyncEngine {
// Debug output of change evaluation items
if (debugLogging) {
addLogEntry("defaultRootId = " ~ appConfig.defaultRootId, ["debug"]);
addLogEntry("'search id' = " ~ thisItemId, ["debug"]);
addLogEntry("id == defaultRootId = " ~ to!string(itemIdMatchesDefaultRootId), ["debug"]);
addLogEntry("thisItemName = " ~ onedriveJSONItem["name"].str, ["debug"]);
addLogEntry("thisItemId = " ~ thisItemId, ["debug"]);
addLogEntry("thisItemId == defaultRootId = " ~ to!string(itemIdMatchesDefaultRootId), ["debug"]);
addLogEntry("isItemRoot(onedriveJSONItem) = " ~ to!string(itemIsRoot), ["debug"]);
addLogEntry("onedriveJSONItem['name'].str == 'root' = " ~ to!string(itemNameExplicitMatchRoot), ["debug"]);
addLogEntry("itemHasParentReferenceId = " ~ to!string(itemHasParentReferenceId), ["debug"]);
Expand Down Expand Up @@ -1873,8 +1874,8 @@ class SyncEngine {
if (!unwanted) {
// Only check path if config is != ""
if (!appConfig.getValueString("skip_dir").empty) {
// Is the item a folder?
if (isItemFolder(onedriveJSONItem)) {
// Is the item a folder or a remote item? (which itself is a directory, but is missing the 'folder' JSON element we use to determine JSON being a directory or not)
if ((isItemFolder(onedriveJSONItem)) || (isRemoteFolderItem(onedriveJSONItem))) {
// work out the 'snippet' path where this folder would be created
string simplePathToCheck = "";
string complexPathToCheck = "";
Expand Down
8 changes: 8 additions & 0 deletions src/util.d
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,14 @@ bool isFolderItem(const ref JSONValue item) {
return ("folder" in item) != null;
}

bool isRemoteFolderItem(const ref JSONValue item) {
if (isItemRemote(item)) {
return ("folder" in item["remoteItem"]) != null;
} else {
return false;
}
}

bool isFileItem(const ref JSONValue item) {
return ("file" in item) != null;
}
Expand Down

0 comments on commit cbd9127

Please sign in to comment.