From 14b0ec2e96a2efb24e64500b5929b1bb97d909b0 Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Sat, 14 Jul 2007 08:24:54 +0000 Subject: [PATCH] Fixed up EVENT_FINISHED event in core.handle_events(self). --- src/core.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index 449e16239..b89c25c7e 100644 --- a/src/core.py +++ b/src/core.py @@ -523,6 +523,13 @@ 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) @@ -530,7 +537,7 @@ class Manager: if 'unique_ID' in event and \ event['unique_ID'] not in self.unique_IDs: continue - + # Call plugins events callbacks if event['event_type'] in self.event_callbacks: for plugin_instance in self.event_callbacks[event['event_type']]: