From a2af284ccfb0164055edd653ed94680ecc956ec3 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Tue, 14 Mar 2017 12:30:54 -0400 Subject: [PATCH] Update Watch logic for new API wrapper Also was using some keys that are no longer available from file_list - fixed that --- ui/CHANGELOG.md | 2 +- ui/js/page/watch.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index 0226d5f88..f875ffe07 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -18,7 +18,7 @@ Web UI version numbers should always match the corresponding version of LBRY App * ### Fixed - * + * Fix Watch page and progress bars for new API changes * * diff --git a/ui/js/page/watch.js b/ui/js/page/watch.js index 7d67ea56a..9d7bdb75b 100644 --- a/ui/js/page/watch.js +++ b/ui/js/page/watch.js @@ -27,7 +27,7 @@ var WatchPage = React.createClass({ }; }, componentDidMount: function() { - lbry.get({name: this.props.name}, (fileInfo) => { + lbry.get({name: this.props.name}).then((fileInfo) => { this._outpoint = fileInfo.outpoint; this.updateLoadStatus(); }); @@ -67,11 +67,11 @@ var WatchPage = React.createClass({ } }, updateLoadStatus: function() { - api.file_list({ + lbry.file_list({ outpoint: this._outpoint, full_status: true, - }, ([status]) => { - if (!status || !['running', 'stopped'].includes(status.code) || status.written_bytes == 0) { + }).then(([status]) => { + if (!status || status.written_bytes == 0) { // Download hasn't started yet, so update status message (if available) then try again // TODO: Would be nice to check if we have the MOOV before starting playing if (status) {