mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
don't use libtorrent anymore in add
This commit is contained in:
parent
62f6683730
commit
5f0f7204a8
1 changed files with 3 additions and 10 deletions
|
@ -36,21 +36,14 @@
|
||||||
# statement from all source files in the program, then also delete it here.
|
# statement from all source files in the program, then also delete it here.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
from twisted.internet import defer
|
|
||||||
|
|
||||||
from deluge.ui.client import client
|
from deluge.ui.client import client
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
from deluge.ui.common import TorrentInfo
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
|
||||||
from optparse import make_option
|
|
||||||
import os,base64,glob
|
import os,base64,glob
|
||||||
|
|
||||||
try:
|
|
||||||
import libtorrent
|
|
||||||
add_get_info = libtorrent.torrent_info
|
|
||||||
except:
|
|
||||||
import deluge.ui.common
|
|
||||||
add_get_info = deluge.ui.common.TorrentInfo
|
|
||||||
|
|
||||||
def add_torrent(t_file, options, success_cb, fail_cb, ress):
|
def add_torrent(t_file, options, success_cb, fail_cb, ress):
|
||||||
t_options = {}
|
t_options = {}
|
||||||
|
@ -82,7 +75,7 @@ def add_torrent(t_file, options, success_cb, fail_cb, ress):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
add_get_info(f)
|
TorrentInfo(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
fail_cb(e.message,f,ress)
|
fail_cb(e.message,f,ress)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue