Attempt to handle the issue with fast resume. Thanks, eternalswd.

This commit is contained in:
Alex Dedul 2007-07-18 14:19:39 +00:00
parent d209d8d7ed
commit ff8c02b8ce
3 changed files with 17 additions and 17 deletions

View File

@ -57,10 +57,11 @@ class TorrentNotification:
self.dialog = self.glade.get_widget("dialog")
def handle_event(self, event):
if self.config.get("enable_tray_blink"):
self.set_tray_flashing_on()
if self.config.get("enable_notification"):
self.show_notification(event)
if event['message'] == "torrent has finished downloading":
if self.config.get("enable_tray_blink"):
self.set_tray_flashing_on()
if self.config.get("enable_notification"):
self.show_notification(event)
def unload(self):
self.core.disconnect_event(self.core.constants['EVENT_FINISHED'], self.handle_event)

View File

@ -556,13 +556,6 @@ class Manager:
if event is None:
break
# EVENT_FINISHED fires after integrity checks as well, so ensure
# we actually downloaded torrent now by making sure at least some
# bytes have been downloaded for it in this session
if event['event_type'] is self.constants['EVENT_FINISHED'] and \
self.get_core_torrent_state(event['unique_ID'])['total_payload_download'] == 0:
continue
# print "EVENT: ", event
ret.append(event)
@ -583,16 +576,21 @@ class Manager:
self.unique_IDs[event['unique_ID']].save_dir = self.get_pref('default_finished_path')
elif event['event_type'] is self.constants['EVENT_FINISHED']:
# Queue seeding torrent to bottom if needed
if self.get_pref('enable_move_completed') and not \
(self.get_pref('default_finished_path') == self.get_pref('default_download_path')):
(self.get_pref('default_finished_path') == self.get_pref('default_download_path')) and \
event['message'] == "torrent has finished downloading":
deluge_core.move_storage(event['unique_ID'], self.get_pref('default_finished_path'))
# Queue seeding torrent to bottom if needed
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
if self.get_pref('auto_seed_ratio') == -1:
self.apply_queue(efficient = False) # To work on current data
#save fast resume once torrent finshes so as to not recheck seed if client crashes
# save fast resume once torrent finishes so as to not recheck
# seed if client crashes
self.save_fastresume_data(event['unique_ID'])
elif event['event_type'] is self.constants['EVENT_TRACKER']:
unique_ID = event['unique_ID']

View File

@ -749,9 +749,10 @@ static PyObject *torrent_pop_event(PyObject *self, PyObject *args)
return NULL;
if (handle_exists(handle))
return Py_BuildValue("{s:i,s:i}", "event_type", EVENT_FINISHED,
"unique_ID",
M_torrents->at(index).unique_ID);
return Py_BuildValue("{s:i,s:i,s:s}",
"event_type", EVENT_FINISHED,
"unique_ID", M_torrents->at(index).unique_ID,
"message", a->msg().c_str());
else
{ Py_INCREF(Py_None); return Py_None; }
} else if (dynamic_cast<peer_error_alert*>(popped_alert))