Changeset b0c3c3
- Timestamp:
- 01/17/2014 10:48:42 AM (12 years ago)
- Branches:
- 2.0.x, develop, master
- Children:
- 624f2f
- Parents:
- 8eb215
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (01/17/2014 10:48:32 AM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (01/17/2014 10:48:42 AM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/core/torrentmanager.py
r8eb215 rb0c3c3 316 316 317 317 def add(self, torrent_info=None, state=None, options=None, save_state=True, 318 filedump=None, filename=None, magnet=None, resume_data=None, owner=None):318 filedump=None, filename=None, magnet=None, resume_data=None, seed_mode=False, owner=None): 319 319 """Add a torrent to the manager and returns it's torrent_id""" 320 320 if torrent_info is None and state is None and filedump is None and magnet is None: … … 442 442 add_torrent_params["save_path"] = utf8_encoded(options["download_location"]) 443 443 add_torrent_params["storage_mode"] = storage_mode 444 add_torrent_params["paused"] = True 445 add_torrent_params["auto_managed"] = False 446 add_torrent_params["duplicate_is_error"] = True 444 add_torrent_params["flags"] = (lt.add_torrent_params_flags_t.flag_paused | 445 lt.add_torrent_params_flags_t.flag_duplicate_is_error) 446 if seed_mode: 447 add_torrent_params["flags"] |= lt.add_torrent_params_flags_t.flag_seed_mode 448 if magnet: 449 add_torrent_params["url"] = utf8_encoded(magnet) 447 450 448 451 # We need to pause the AlertManager momentarily to prevent alerts … … 452 455 handle = None 453 456 try: 454 if magnet: 455 handle = lt.add_magnet_uri(self.session, utf8_encoded(magnet), add_torrent_params) 456 else: 457 handle = self.session.add_torrent(add_torrent_params) 457 handle = self.session.add_torrent(add_torrent_params) 458 458 except RuntimeError as ex: 459 459 log.warning("Error adding torrent: %s", ex)
Note:
See TracChangeset
for help on using the changeset viewer.