Attempt to handle the issue with fast resume. Thanks, eternalswd.
This commit is contained in:
parent
d209d8d7ed
commit
ff8c02b8ce
|
@ -57,6 +57,7 @@ class TorrentNotification:
|
||||||
self.dialog = self.glade.get_widget("dialog")
|
self.dialog = self.glade.get_widget("dialog")
|
||||||
|
|
||||||
def handle_event(self, event):
|
def handle_event(self, event):
|
||||||
|
if event['message'] == "torrent has finished downloading":
|
||||||
if self.config.get("enable_tray_blink"):
|
if self.config.get("enable_tray_blink"):
|
||||||
self.set_tray_flashing_on()
|
self.set_tray_flashing_on()
|
||||||
if self.config.get("enable_notification"):
|
if self.config.get("enable_notification"):
|
||||||
|
|
18
src/core.py
18
src/core.py
|
@ -556,13 +556,6 @@ class Manager:
|
||||||
if event is None:
|
if event is None:
|
||||||
break
|
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
|
# print "EVENT: ", event
|
||||||
|
|
||||||
ret.append(event)
|
ret.append(event)
|
||||||
|
@ -583,16 +576,21 @@ class Manager:
|
||||||
self.unique_IDs[event['unique_ID']].save_dir = self.get_pref('default_finished_path')
|
self.unique_IDs[event['unique_ID']].save_dir = self.get_pref('default_finished_path')
|
||||||
|
|
||||||
elif event['event_type'] is self.constants['EVENT_FINISHED']:
|
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 \
|
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'))
|
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'):
|
if self.get_pref('queue_seeds_to_bottom'):
|
||||||
self.queue_bottom(event['unique_ID'])
|
self.queue_bottom(event['unique_ID'])
|
||||||
|
|
||||||
# If we are autoseeding, then we need to apply the queue
|
# If we are autoseeding, then we need to apply the queue
|
||||||
if self.get_pref('auto_seed_ratio') == -1:
|
if self.get_pref('auto_seed_ratio') == -1:
|
||||||
self.apply_queue(efficient = False) # To work on current data
|
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'])
|
self.save_fastresume_data(event['unique_ID'])
|
||||||
elif event['event_type'] is self.constants['EVENT_TRACKER']:
|
elif event['event_type'] is self.constants['EVENT_TRACKER']:
|
||||||
unique_ID = event['unique_ID']
|
unique_ID = event['unique_ID']
|
||||||
|
|
|
@ -749,9 +749,10 @@ static PyObject *torrent_pop_event(PyObject *self, PyObject *args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (handle_exists(handle))
|
if (handle_exists(handle))
|
||||||
return Py_BuildValue("{s:i,s:i}", "event_type", EVENT_FINISHED,
|
return Py_BuildValue("{s:i,s:i,s:s}",
|
||||||
"unique_ID",
|
"event_type", EVENT_FINISHED,
|
||||||
M_torrents->at(index).unique_ID);
|
"unique_ID", M_torrents->at(index).unique_ID,
|
||||||
|
"message", a->msg().c_str());
|
||||||
else
|
else
|
||||||
{ Py_INCREF(Py_None); return Py_None; }
|
{ Py_INCREF(Py_None); return Py_None; }
|
||||||
} else if (dynamic_cast<peer_error_alert*>(popped_alert))
|
} else if (dynamic_cast<peer_error_alert*>(popped_alert))
|
||||||
|
|
Loading…
Reference in New Issue