Fix adding torrents by URL.

This commit is contained in:
Andrew Resch 2008-01-14 08:46:44 +00:00
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 because the torrent was not added successfully
return False 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) log.info("Attempting to add url %s", url)
# Get the actual filename of the torrent from the url provided. # Get the actual filename of the torrent from the url provided.
@ -302,7 +302,8 @@ class Core(
return False return False
# Add the torrent to session # 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): def export_remove_torrent(self, torrent_id, remove_torrent, remove_data):
log.debug("Removing torrent %s from the core.", torrent_id) 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. # The torrent was not added successfully.
log.warning("Torrent %s was not added successfully.", filename) 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""" """Adds torrents to the core via url"""
from deluge.common import is_url from deluge.common import is_url
if is_url(torrent_url): if is_url(torrent_url):
try: try:
result = get_core().add_torrent_url(torrent_url, str()) result = get_core().add_torrent_url(torrent_url, str(), options)
except (AttributeError, socket.error): except (AttributeError, socket.error):
set_core_uri(None) set_core_uri(None)
result = False result = False