diff --git a/native-src/placeholders_interface/Planceholders.cpp b/native-src/placeholders_interface/Planceholders.cpp index a3485bb7..18a67c88 100644 --- a/native-src/placeholders_interface/Planceholders.cpp +++ b/native-src/placeholders_interface/Planceholders.cpp @@ -497,29 +497,41 @@ std::vector Placeholders::GetPlaceholderWithStatePending(const std { std::vector resultPaths; - for (const auto &entry : std::filesystem::directory_iterator(directoryPath)) + try { - const auto &path = entry.path().wstring(); - - if (entry.is_directory()) - { - std::vector subfolderPaths = GetPlaceholderWithStatePending(path); - resultPaths.insert(resultPaths.end(), subfolderPaths.begin(), subfolderPaths.end()); - } - else if (entry.is_regular_file()) + for (const auto &entry : std::filesystem::directory_iterator(directoryPath, std::filesystem::directory_options::skip_permission_denied)) { - FileState placeholderState = Placeholders::GetPlaceholderInfo(path); - bool isFileValidForSync = (placeholderState.syncstate == SyncState::Undefined || placeholderState.syncstate == SyncState::NotInSync); - if (isFileValidForSync && IsFileValidForSync(path)) + const auto &path = entry.path().wstring(); + + if (entry.is_directory()) + { + FileState folderState = Placeholders::GetPlaceholderInfo(path); + + if (folderState.syncstate == SyncState::Undefined || folderState.syncstate == SyncState::NotInSync) + { + std::vector subfolderPaths = GetPlaceholderWithStatePending(path); + resultPaths.insert(resultPaths.end(), subfolderPaths.begin(), subfolderPaths.end()); + } + } + else if (entry.is_regular_file()) { - resultPaths.push_back(path); + FileState placeholderState = Placeholders::GetPlaceholderInfo(path); + + bool isFileValidForSync = (placeholderState.syncstate == SyncState::Undefined || placeholderState.syncstate == SyncState::NotInSync); + if (isFileValidForSync && IsFileValidForSync(path)) + { + resultPaths.push_back(path); + } } } } + catch (const std::exception &e) + { + wprintf(L"[GetPlaceholderWithStatePending] Error: %s\n", e.what()); + } return resultPaths; } - bool Placeholders::IsFileValidForSync(const std::wstring &filePath) { // Obtener un handle al archivo @@ -553,7 +565,7 @@ bool Placeholders::IsFileValidForSync(const std::wstring &filePath) } LARGE_INTEGER maxFileSize; - maxFileSize.QuadPart = 20LL * 1024 * 1024 * 1024; // 20GB + maxFileSize.QuadPart = 40LL * 1024 * 1024 * 1024; // 20GB if (fileSize.QuadPart > maxFileSize.QuadPart) { diff --git a/package.json b/package.json index 83f9252c..fe1d8f44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/node-win", - "version": "1.0.16", + "version": "1.0.17", "description": "Drive desktop node addon", "main": "dist/index.js", "types": "dist/index.d.ts",