Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions native-src/placeholders_interface/Planceholders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,29 +497,41 @@ std::vector<std::wstring> Placeholders::GetPlaceholderWithStatePending(const std
{
std::vector<std::wstring> resultPaths;

for (const auto &entry : std::filesystem::directory_iterator(directoryPath))
try
{
const auto &path = entry.path().wstring();

if (entry.is_directory())
{
std::vector<std::wstring> 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<std::wstring> 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
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down