Change order of Microsoft OneDrive restrictions and limitations check and skip_file|skip_dir (#2238)

* Perform check against Microsoft OneDrive restriction and limitations after user configured items to skip has been performed
This commit is contained in:
abraunegg 2022-11-26 05:42:38 +11:00 committed by GitHub
parent 87003c5923
commit 0b89a1fea0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3603,7 +3603,6 @@ final class SyncEngine
return; return;
} }
} }
// Is the path excluded? // Is the path excluded?
unwanted = selectiveSync.isDirNameExcluded(item.name); unwanted = selectiveSync.isDirNameExcluded(item.name);
} }
@ -3630,7 +3629,7 @@ final class SyncEngine
return; return;
} }
// Restriction and limitations about windows naming files // Check against Microsoft OneDrive restriction and limitations about Windows naming files
if (!isValidName(path)) { if (!isValidName(path)) {
log.logAndNotify("Skipping item - invalid name (Microsoft Naming Convention): ", path); log.logAndNotify("Skipping item - invalid name (Microsoft Naming Convention): ", path);
return; return;
@ -4342,12 +4341,6 @@ final class SyncEngine
} }
} }
// Restriction and limitations about windows naming files
if (!isValidName(path)) {
log.logAndNotify("Skipping item - invalid name (Microsoft Naming Convention): ", path);
return;
}
// Check for bad whitespace items // Check for bad whitespace items
if (!containsBadWhiteSpace(path)) { if (!containsBadWhiteSpace(path)) {
log.logAndNotify("Skipping item - invalid name (Contains an invalid whitespace item): ", path); log.logAndNotify("Skipping item - invalid name (Contains an invalid whitespace item): ", path);
@ -4360,7 +4353,7 @@ final class SyncEngine
return; return;
} }
// filter out user configured items to skip // Is this item excluded by user configuration of skip_dir or skip_file?
if (path != ".") { if (path != ".") {
if (isDir(path)) { if (isDir(path)) {
log.vdebug("Checking local path: ", path); log.vdebug("Checking local path: ", path);
@ -4421,6 +4414,12 @@ final class SyncEngine
} }
} }
} }
// Check against Microsoft OneDrive restriction and limitations about Windows naming files
if (!isValidName(path)) {
log.logAndNotify("Skipping item - invalid name (Microsoft Naming Convention): ", path);
return;
}
// We want to upload this new item // We want to upload this new item
if (isDir(path)) { if (isDir(path)) {
@ -5979,7 +5978,7 @@ final class SyncEngine
} }
} }
// Restriction and limitations about windows naming files // Check against Microsoft OneDrive restriction and limitations about Windows naming files
if (!isValidName(to)) { if (!isValidName(to)) {
log.logAndNotify("Skipping item - invalid name (Microsoft Naming Convention): ", to); log.logAndNotify("Skipping item - invalid name (Microsoft Naming Convention): ", to);
return; return;