Check shared folder DB entries for matching skip_dir items (#1003)

* Check shared folder DB entries for matching skip_dir items
This commit is contained in:
abraunegg 2020-07-28 07:00:34 +10:00 committed by GitHub
parent a87897ba3f
commit 928ad9512f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -543,6 +543,17 @@ final class SyncEngine
// https://github.com/OneDrive/onedrive-api-docs/issues/764
Item[] items = itemdb.selectRemoteItems();
foreach (item; items) {
// Only check path if config is != ""
if (cfg.getValueString("skip_dir") != "") {
// The path that needs to be checked needs to include the '/'
// This due to if the user has specified in skip_dir an exclusive path: '/path' - that is what must be matched
if (selectiveSync.isDirNameExcluded(item.name)) {
// This directory name is excluded
log.vlog("Skipping item - excluded by skip_dir config: ", item.name);
continue;
}
}
// Directory name is not excluded or skip_dir is not populated
log.vdebug("------------------------------------------------------------------");
if (!cfg.getValueBool("monitor")) {
log.log("Syncing this OneDrive Personal Shared Folder: ", item.name);
@ -1838,7 +1849,7 @@ final class SyncEngine
}
log.vdebug("Result: ", unwanted);
if (unwanted) log.vlog("Skipping item - excluded by skip_dir config match: ", matchDisplay);
if (unwanted) log.vlog("Skipping item - excluded by skip_dir config: ", matchDisplay);
}
}
}