mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-19 22:25:03 +02:00
Update sync.d
* Change local directory creation to a reusable function
This commit is contained in:
parent
47bce636e4
commit
e895a1174c
19
src/sync.d
19
src/sync.d
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue