From f5c3e7643d9f1b08c13e9c99f4c723cfe1a6e618 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Fri, 22 Mar 2019 15:21:59 +1100 Subject: [PATCH] Update 'skip_dir' handling to check against OneDrive new downloads (#427) * Add check for directories to match skip_dir entries for OneDrive objects to download * Update logging as to why a OneDrive object was skipped --- src/sync.d | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sync.d b/src/sync.d index 4ebbb041..c1849ea1 100644 --- a/src/sync.d +++ b/src/sync.d @@ -754,9 +754,17 @@ final class SyncEngine bool unwanted; unwanted |= skippedItems.find(item.parentId).length != 0; if (unwanted) log.vdebug("Flagging as unwanted: find(item.parentId).length != 0"); - unwanted |= selectiveSync.isFileNameExcluded(item.name); - if (unwanted) log.vdebug("Flagging as unwanted: item name is excluded: ", item.name); - + // Check if this is a directory to skip + if (!unwanted) { + unwanted = selectiveSync.isDirNameExcluded(item.name); + if (unwanted) log.vlog("Skipping item - excluded by skip_dir config: ", item.name); + } + // Check if this is a file to skip + if (!unwanted) { + unwanted = selectiveSync.isFileNameExcluded(item.name); + if (unwanted) log.vlog("Skipping item - excluded by skip_file config: ", item.name); + } + // check the item type if (!unwanted) { if (isItemFile(driveItem)) {