--- ui/web/json_api.py.dist 2019-06-12 23:17:45.000000000 +0200 +++ ui/web/json_api.py 2020-05-03 19:29:23.309721987 +0200 @@ -724,7 +724,8 @@ Add torrents by file :param torrents: A list of dictionaries containing the torrent \ - path and torrent options to add with. + path, torrent data and torrent options to add with. Torrent data \ + is optional and must be encoded with base64. :type torrents: list :: @@ -748,8 +749,10 @@ deferreds.append(d) else: filename = os.path.basename(torrent['path']) - with open(torrent['path'], 'rb') as _file: - fdump = b64encode(_file.read()) + fdump = torrent.pop("data", None) + if fdump == None: + with open(torrent['path'], 'rb') as _file: + fdump = b64encode(_file.read()) log.info( 'Adding torrent from file `%s` with options `%r`', filename, @@ -759,7 +764,7 @@ filename, fdump, torrent['options'] ) deferreds.append(d) - return DeferredList(deferreds, consumeErrors=False) + return DeferredList(deferreds, consumeErrors=True, fireOnOneErrback=True) def _get_host(self, host_id): """Information about a host from supplied host id.