Ticket #3367: deluge-2.0.3+add_torrents_instream.patch
File deluge-2.0.3+add_torrents_instream.patch, 1.0 KB (added by lalbornoz, 4 years ago) |
---|
-
ui/web/json_api.py
old new 724 724 Add torrents by file 725 725 726 726 :param torrents: A list of dictionaries containing the torrent \ 727 path and torrent options to add with. 727 path, torrent data and torrent options to add with. Torrent data \ 728 is optional and must be encoded with base64. 728 729 :type torrents: list 729 730 730 731 :: … … 748 749 deferreds.append(d) 749 750 else: 750 751 filename = os.path.basename(torrent['path']) 751 with open(torrent['path'], 'rb') as _file: 752 fdump = b64encode(_file.read()) 752 fdump = torrent.pop("data", None) 753 if fdump == None: 754 with open(torrent['path'], 'rb') as _file: 755 fdump = b64encode(_file.read()) 753 756 log.info( 754 757 'Adding torrent from file `%s` with options `%r`', 755 758 filename,