From 4a6c78a7a6a83b1c52700da0972ad671f2785969 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Thu, 10 Nov 2022 07:03:58 +1100 Subject: [PATCH] Only calculate path with computeItemPath if path is empty (#2212) * Only calculate path with computeItemPath if path is empty, avoiding a double calculation and DB operations --- src/sync.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sync.d b/src/sync.d index 33bfecc4..3bb6aefb 100644 --- a/src/sync.d +++ b/src/sync.d @@ -2406,7 +2406,10 @@ final class SyncEngine // Is the item parent in the local database? if (itemdb.idInLocalDatabase(item.driveId, item.parentId)){ // compute the item path to see if the path is excluded & need the full path for this file - path = computeItemPath(item.driveId, item.parentId) ~ "/" ~ item.name; + log.vdebug("sync_list item to check: ", path); + if (path.empty) { + path = computeItemPath(item.driveId, item.parentId) ~ "/" ~ item.name; + } path = buildNormalizedPath(path); if (selectiveSync.isPathExcludedViaSyncList(path)) { // selective sync advised to skip, however is this a file and are we configured to upload / download files in the root?