only change storage dir location if move is successful

This commit is contained in:
Marcos Pinto 2007-07-11 20:59:33 +00:00
parent cd70b85850
commit 7938cb7fba
2 changed files with 8 additions and 7 deletions

View File

@ -528,8 +528,12 @@ class Manager:
if event['event_type'] is self.constants['EVENT_FINISHED']:
# Queue seeding torrent to bottom if needed
if(self.get_pref('enable_move_completed')):
deluge_core.move_storage(event['unique_ID'], self.get_pref('default_finished_path'))
self.unique_IDs[event['unique_ID']].save_dir = self.get_pref('default_finished_path')
try:
deluge_core.move_storage(event['unique_ID'], self.get_pref('default_finished_path'))
except SystemError:
print "You cannot move downloaded file/folder to a different partition"
else:
self.unique_IDs[event['unique_ID']].save_dir = self.get_pref('default_finished_path')
if self.get_pref('queue_seeds_to_bottom'):
self.queue_bottom(event['unique_ID'])
# If we are autoseeding, then we need to apply the queue

View File

@ -548,12 +548,9 @@ static PyObject *torrent_move_storage(PyObject *self, PyObject *args)
boost::filesystem::path move_dir_2 (move_dir, empty_name_check);
try
{
/*libtorrent's move_storage only works within same partition
move_storage returns afterwards save_path should equal move_dir_2*/
M_torrents->at(index).handle.move_storage(move_dir_2);
//if(M_torrents->at(index).handle.save_path()!=move_dir_2)
//return NULL;
//throw error here to let user know
if(M_torrents->at(index).handle.save_path()!=move_dir_2)
return NULL;
}
catch (boost::filesystem::filesystem_error&)
{ RAISE_PTR(FilesystemError, ""); }