Skip to content

Commit 7c3ac18

Browse files
committed
update metadata when a file item has wrong type in DB
should help fixing the type of windows shortcuts in DB that were wrongly set as virtual files Signed-off-by: Matthieu Gallien <[email protected]>
1 parent b8f853a commit 7c3ac18

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libsync/discovery.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,18 @@ void ProcessDirectoryJob::processFileFinalize(
16791679
item->_type = CSyncEnums::ItemTypeVirtualFileDehydration;
16801680
}
16811681

1682+
if (item->_instruction != CSyncEnums::CSYNC_INSTRUCTION_NONE &&
1683+
!item->isDirectory() &&
1684+
_discoveryData->_syncOptions._vfs &&
1685+
_discoveryData->_syncOptions._vfs->mode() == OCC::Vfs::Off &&
1686+
(item->_type == CSyncEnums::ItemTypeVirtualFile ||
1687+
item->_type == CSyncEnums::ItemTypeVirtualFileDownload ||
1688+
item->_type == CSyncEnums::ItemTypeVirtualFileDehydration)) {
1689+
item->_instruction = CSyncEnums::CSYNC_INSTRUCTION_UPDATE_METADATA;
1690+
item->_direction = SyncFileItem::Down;
1691+
item->_type = CSyncEnums::ItemTypeFile;
1692+
}
1693+
16821694
if (path._original != path._target && (item->_instruction == CSYNC_INSTRUCTION_UPDATE_VFS_METADATA || item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA || item->_instruction == CSYNC_INSTRUCTION_NONE)) {
16831695
ASSERT(_dirItem && _dirItem->_instruction == CSYNC_INSTRUCTION_RENAME);
16841696
// This is because otherwise subitems are not updated! (ideally renaming a directory could

0 commit comments

Comments
 (0)