Change torrent location even if no data move is needed

This helps when old and new location point to the same place but the actual
path differs (i.e. one of the paths is a symlink).

Fixes: #35
This commit is contained in:
Mike Gelfand 2017-07-06 21:46:32 +03:00
parent 7e6f1a8dc8
commit 8c88e8bba0
1 changed files with 12 additions and 12 deletions

View File

@ -3348,24 +3348,24 @@ static void setLocation(void* vdata)
}
}
if (!err)
if (!err && do_move)
{
/* blow away the leftover subdirectories in the old location */
if (do_move)
{
tr_torrentDeleteLocalData(tor, tr_sys_path_remove);
}
/* set the new location and reverify */
tr_torrentSetDownloadDir(tor, location);
tr_torrentDeleteLocalData(tor, tr_sys_path_remove);
}
}
if (!err && do_move)
if (!err)
{
tr_free(tor->incompleteDir);
tor->incompleteDir = NULL;
tor->currentDir = tor->downloadDir;
/* set the new location and reverify */
tr_torrentSetDownloadDir(tor, location);
if (do_move)
{
tr_free(tor->incompleteDir);
tor->incompleteDir = NULL;
tor->currentDir = tor->downloadDir;
}
}
if (data->setme_state != NULL)