Fix adding torrents by URL.

This commit is contained in:
Andrew Resch 2008-01-14 08:46:44 +00:00
parent 5a90f48ccb
commit eaddaaa844
2 changed files with 5 additions and 4 deletions

View File

@ -283,7 +283,7 @@ class Core(
# Return False because the torrent was not added successfully
return False
def export_add_torrent_url(self, url, save_path):
def export_add_torrent_url(self, url, save_path, options):
log.info("Attempting to add url %s", url)
# Get the actual filename of the torrent from the url provided.
@ -302,7 +302,8 @@ class Core(
return False
# Add the torrent to session
return self.export_add_torrent_file(filename, save_path, filedump)
return self.export_add_torrent_file(
filename, save_path, filedump, options)
def export_remove_torrent(self, torrent_id, remove_torrent, remove_data):
log.debug("Removing torrent %s from the core.", torrent_id)

View File

@ -263,12 +263,12 @@ def add_torrent_file(torrent_files, torrent_options=None):
# The torrent was not added successfully.
log.warning("Torrent %s was not added successfully.", filename)
def add_torrent_url(torrent_url):
def add_torrent_url(torrent_url, options=None):
"""Adds torrents to the core via url"""
from deluge.common import is_url
if is_url(torrent_url):
try:
result = get_core().add_torrent_url(torrent_url, str())
result = get_core().add_torrent_url(torrent_url, str(), options)
except (AttributeError, socket.error):
set_core_uri(None)
result = False