mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-19 14:16:36 +02:00
Add a check to handle moving items out of sync scope & delete locally if true (#604)
* Add a check to handle moving items out of sync scope & delete locally if true
This commit is contained in:
parent
3171318503
commit
8f71043f23
22
src/sync.d
22
src/sync.d
|
@ -842,8 +842,26 @@ final class SyncEngine
|
|||
}
|
||||
|
||||
bool unwanted;
|
||||
unwanted |= skippedItems.find(item.parentId).length != 0;
|
||||
if (unwanted) log.vdebug("Flagging as unwanted: find(item.parentId).length != 0");
|
||||
// Check if the parent id is something we need to skip
|
||||
if (skippedItems.find(item.parentId).length != 0) {
|
||||
// Potentially need to flag as unwanted
|
||||
log.vdebug("Flagging as unwanted: find(item.parentId).length != 0");
|
||||
unwanted = true;
|
||||
|
||||
// Is this item id in the database?
|
||||
if (itemdb.idInLocalDatabase(item.driveId, item.id)){
|
||||
// item exists in database, most likely moved out of scope for current client configuration
|
||||
log.vdebug("This item was previously synced / seen by the client");
|
||||
if (selectiveSync.isPathExcluded(driveItem["parentReference"]["name"].str)) {
|
||||
// Previously synced item is now out of scope as it has been moved out of what is included in sync_list
|
||||
log.vdebug("This previously synced item is now excluded from being synced due to sync_list exclusion");
|
||||
// flag to delete local file as it now is no longer in sync with OneDrive
|
||||
log.vdebug("Flagging to delete item locally");
|
||||
idsToDelete ~= [item.driveId, item.id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this is a directory to skip
|
||||
if (!unwanted) {
|
||||
// Only check path if config is != ""
|
||||
|
|
Loading…
Reference in a new issue