Changeset 2cceb3a
- Timestamp:
- 06/28/2011 12:42:26 AM (14 years ago)
- Children:
- b5a0f3
- Parents:
- 6ad3a7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/core/torrentmanager.py
r6ad3a7 r2cceb3a 411 411 412 412 # If torrent already exists just append any extra trackers. 413 add_torrent_id = str(add_torrent_params["ti"].info_hash()) 414 if add_torrent_id in self.get_torrent_list(): 415 log.debug("Torrent (%s) exists, checking for trackers to add...", add_torrent_id) 416 add_torrent_trackers = [] 417 for value in add_torrent_params["ti"].trackers(): 418 tracker = {} 419 tracker["url"] = value.url 420 tracker["tier"] = value.tier 421 add_torrent_trackers.append(tracker) 422 423 torrent_trackers = {} 424 tracker_list = [] 425 for tracker in self[add_torrent_id].get_status(["trackers"])["trackers"]: 426 torrent_trackers[(tracker["url"])] = tracker 427 tracker_list.append(tracker) 428 429 added_tracker = False 430 for tracker in add_torrent_trackers: 431 if tracker['url'] not in torrent_trackers: 413 if state is None: 414 add_torrent_id = str(add_torrent_params["ti"].info_hash()) 415 if add_torrent_id in self.get_torrent_list(): 416 log.debug("Torrent (%s) exists, checking for trackers to add...", add_torrent_id) 417 add_torrent_trackers = [] 418 for value in add_torrent_params["ti"].trackers(): 419 tracker = {} 420 tracker["url"] = value.url 421 tracker["tier"] = value.tier 422 add_torrent_trackers.append(tracker) 423 424 torrent_trackers = {} 425 tracker_list = [] 426 for tracker in self[add_torrent_id].get_status(["trackers"])["trackers"]: 427 torrent_trackers[(tracker["url"])] = tracker 432 428 tracker_list.append(tracker) 433 added_tracker = True 434 435 if added_tracker: 436 self[add_torrent_id].set_trackers(tracker_list) 437 return 429 430 added_tracker = False 431 for tracker in add_torrent_trackers: 432 if tracker['url'] not in torrent_trackers: 433 tracker_list.append(tracker) 434 added_tracker = True 435 436 if added_tracker: 437 self[add_torrent_id].set_trackers(tracker_list) 438 return 438 439 439 440 # We need to pause the AlertManager momentarily to prevent alerts
Note:
See TracChangeset
for help on using the changeset viewer.