Revert "Revert "Use get_availability to determine stream availability""

This reverts commit 24e43ba42e.

Ok, that wasn't it.
This commit is contained in:
Alex Grintsvayg 2017-02-18 09:59:13 -05:00
parent 24e43ba42e
commit fbb11d78c7
2 changed files with 6 additions and 2 deletions

View file

@ -248,13 +248,13 @@ export let FileActions = React.createClass({
componentDidMount: function() {
this._isMounted = true;
this._fileInfoSubscribeId = lbry.fileInfoSubscribe(this.props.sdHash, this.onFileInfoUpdate);
lbry.getPeersForBlobHash(this.props.sdHash, (peers) => {
lbry.getStreamAvailability(this.props.streamName, (availability) => {
if (!this._isMounted) {
return;
}
this.setState({
available: peers.length > 0,
available: availability > 0,
});
});
},

View file

@ -207,6 +207,10 @@ lbry.getPeersForBlobHash = function(blobHash, callback) {
});
}
lbry.getStreamAvailability = function(name, callback) {
lbry.call('get_availability', {name: name}, callback);
}
lbry.getCostInfoForName = function(name, callback, errorCallback) {
/**
* Takes a LBRY name; will first try and calculate a total cost using