From c2fc15160fb37c71b95d45277da1b725911cb66b Mon Sep 17 00:00:00 2001 From: Job Evers Date: Tue, 3 Jan 2017 18:08:31 -0600 Subject: [PATCH] Fix watch I changed the _download_name return type without realizing that it was also used by the watch endpoint. This switches the endpoint to go through get so that watches can be tracked just like downloads --- lbrynet/lbrynet_daemon/Resources.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lbrynet/lbrynet_daemon/Resources.py b/lbrynet/lbrynet_daemon/Resources.py index d6dbd4443..8f2a64ffb 100644 --- a/lbrynet/lbrynet_daemon/Resources.py +++ b/lbrynet/lbrynet_daemon/Resources.py @@ -82,8 +82,11 @@ class HostedEncryptedFile(resource.Resource): request.setHeader("Content-Security-Policy", "sandbox") if 'name' in request.args.keys(): if self.is_valid_request_name(request): - d = self._api._download_name(request.args['name'][0]) - d.addCallback(lambda stream: self._make_stream_producer(request, stream)) + name = request.args['name'][0] + d = self._api.jsonrpc_get({'name': name}) + d.addCallback(lambda response: response['result']['stream_hash']) + d.addCallback(lambda sd_hash: self._api._get_lbry_file_by_sd_hash(sd_hash)) + d.addCallback(lambda lbry_file: self._make_stream_producer(request, lbry_file)) elif request.args['name'][0] in self._api.waiting_on.keys(): request.redirect(conf.settings.UI_ADDRESS + "/?watch=" + request.args['name'][0]) request.finish()