Update sync.d

* Change local directory creation to a reusable function
This commit is contained in:
abraunegg 2024-02-26 10:32:53 +11:00
parent 47bce636e4
commit e895a1174c

View file

@ -1785,7 +1785,19 @@ class SyncEngine {
break;
case ItemType.dir:
case ItemType.remote:
addLogEntry("Creating local directory: " ~ newItemPath);
handleLocalDirectoryCreation(newDatabaseItem, newItemPath, onedriveJSONItem);
break;
case ItemType.unknown:
// Unknown type - we dont action or sync these items
break;
}
}
// Handle create local directory
void handleLocalDirectoryCreation(Item newDatabaseItem, string newItemPath, JSONValue onedriveJSONItem) {
// Update the logging output to be consistent
addLogEntry("Creating local directory: " ~ "./" ~ buildNormalizedPath(newItemPath));
if (!dryRun) {
try {
// Create the new directory
@ -1813,11 +1825,6 @@ class SyncEngine {
// Save the item to the dry-run database
saveItem(onedriveJSONItem);
}
break;
case ItemType.unknown:
// Unknown type - we dont action or sync these items
break;
}
}
// If the JSON item IS in the database, this will be an update to an existing in-sync item