mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-02 14:02:21 +02:00
treat mv of new file as upload of mv target (Issue: #357)
This commit is contained in:
parent
7532c9d8cc
commit
16da1b4994
|
@ -1826,12 +1826,15 @@ final class SyncEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_move
|
// https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_move
|
||||||
|
// This function is only called in monitor mode when an move event is coming from
|
||||||
|
// inotify and we try to move the item.
|
||||||
void uploadMoveItem(string from, string to)
|
void uploadMoveItem(string from, string to)
|
||||||
{
|
{
|
||||||
log.log("Moving ", from, " to ", to);
|
log.log("Moving ", from, " to ", to);
|
||||||
Item fromItem, toItem, parentItem;
|
Item fromItem, toItem, parentItem;
|
||||||
if (!itemdb.selectByPath(from, defaultDriveId, fromItem)) {
|
if (!itemdb.selectByPath(from, defaultDriveId, fromItem)) {
|
||||||
throw new SyncException("Can't move an unsynced item");
|
uploadNewFile(to);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (fromItem.parentId == null) {
|
if (fromItem.parentId == null) {
|
||||||
// the item is a remote folder, need to do the operation on the parent
|
// the item is a remote folder, need to do the operation on the parent
|
||||||
|
|
Loading…
Reference in a new issue