Merge branch 'master' into i18n

This commit is contained in:
Mayesters 2017-05-26 22:29:31 +02:00
commit b41b35de13
8 changed files with 38 additions and 8 deletions

View file

@ -1,5 +1,5 @@
[bumpversion] [bumpversion]
current_version = 0.11.3 current_version = 0.11.4
commit = True commit = True
tag = True tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<candidate>\d+))? parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<candidate>\d+))?

View file

@ -27,6 +27,18 @@ Web UI version numbers should always match the corresponding version of LBRY App
* *
* *
## [0.11.4] - 2017-05-26
### Added
* New reward for watching weekly featured content
### Fixed
* Video playback will always properly fetch cost info (this was a big playback bug)
* Fixed view rewards
## [0.11.3] - 2017-05-26 ## [0.11.3] - 2017-05-26
### Fixed ### Fixed

View file

@ -1,6 +1,6 @@
{ {
"name": "LBRY", "name": "LBRY",
"version": "0.11.3", "version": "0.11.4",
"main": "main.js", "main": "main.js",
"description": "LBRY is a fully decentralized, open-source protocol facilitating the discovery, access, and (sometimes) purchase of data.", "description": "LBRY is a fully decentralized, open-source protocol facilitating the discovery, access, and (sometimes) purchase of data.",
"author": { "author": {

View file

@ -122,7 +122,6 @@ export function doUpdateLoadStatus(uri, outpoint) {
} else if (fileInfo.completed) { } else if (fileInfo.completed) {
// TODO this isn't going to get called if they reload the client before // TODO this isn't going to get called if they reload the client before
// the download finished // the download finished
rewards.claimNextPurchaseReward()
dispatch({ dispatch({
type: types.DOWNLOADING_COMPLETED, type: types.DOWNLOADING_COMPLETED,
data: { data: {
@ -172,8 +171,11 @@ export function doDownloadFile(uri, streamInfo) {
lbryio.call('file', 'view', { lbryio.call('file', 'view', {
uri: uri, uri: uri,
outpoint: streamInfo.outpoint, outpoint: streamInfo.outpoint,
claimId: streamInfo.claim_id, claim_id: streamInfo.claim_id,
}).catch(() => {}) }).catch(() => {})
rewards.claimEligiblePurchaseRewards()
dispatch(doUpdateLoadStatus(uri, streamInfo.outpoint)) dispatch(doUpdateLoadStatus(uri, streamInfo.outpoint))
} }
} }

View file

@ -11,6 +11,9 @@ import {
import { import {
makeSelectFileInfoForUri, makeSelectFileInfoForUri,
} from 'selectors/file_info' } from 'selectors/file_info'
import {
doFetchCostInfoForUri,
} from 'actions/cost_info'
import { import {
makeSelectClaimForUri, makeSelectClaimForUri,
makeSelectContentTypeForUri, makeSelectContentTypeForUri,
@ -41,7 +44,8 @@ const makeSelect = () => {
const perform = (dispatch) => ({ const perform = (dispatch) => ({
navigate: (path, params) => dispatch(doNavigate(path, params)), navigate: (path, params) => dispatch(doNavigate(path, params)),
fetchFileInfo: (uri) => dispatch(doFetchFileInfo(uri)) fetchFileInfo: (uri) => dispatch(doFetchFileInfo(uri)),
fetchCostInfo: (uri) => dispatch(doFetchCostInfoForUri(uri)),
}) })
export default connect(makeSelect, perform)(FilePage) export default connect(makeSelect, perform)(FilePage)

View file

@ -46,6 +46,7 @@ class FilePage extends React.Component{
componentDidMount() { componentDidMount() {
this.fetchFileInfo(this.props) this.fetchFileInfo(this.props)
this.fetchCostInfo(this.props)
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
@ -58,6 +59,12 @@ class FilePage extends React.Component{
} }
} }
fetchCostInfo(props) {
if (props.costInfo === undefined) {
props.fetchCostInfo(props.uri)
}
}
render() { render() {
const { const {
claim, claim,

View file

@ -76,6 +76,7 @@ rewards.TYPE_FIRST_CHANNEL = "new_channel",
rewards.TYPE_FIRST_STREAM = "first_stream", rewards.TYPE_FIRST_STREAM = "first_stream",
rewards.TYPE_MANY_DOWNLOADS = "many_downloads", rewards.TYPE_MANY_DOWNLOADS = "many_downloads",
rewards.TYPE_FIRST_PUBLISH = "first_publish"; rewards.TYPE_FIRST_PUBLISH = "first_publish";
rewards.TYPE_FEATURED_DOWNLOAD = "featured_download";
rewards.claimReward = function (type) { rewards.claimReward = function (type) {
@ -155,9 +156,10 @@ rewards.claimReward = function (type) {
}); });
} }
rewards.claimNextPurchaseReward = function() { rewards.claimEligiblePurchaseRewards = function() {
let types = {} let types = {}
types[rewards.TYPE_FIRST_STREAM] = false types[rewards.TYPE_FIRST_STREAM] = false
types[rewards.TYPE_FEATURED_DOWNLOAD] = false
types[rewards.TYPE_MANY_DOWNLOADS] = false types[rewards.TYPE_MANY_DOWNLOADS] = false
lbryio.call('reward', 'list', {}).then((userRewards) => { lbryio.call('reward', 'list', {}).then((userRewards) => {
userRewards.forEach((reward) => { userRewards.forEach((reward) => {
@ -166,11 +168,14 @@ rewards.claimNextPurchaseReward = function() {
} }
}) })
let unclaimedType = Object.keys(types).find((type) => { let unclaimedType = Object.keys(types).find((type) => {
return types[type] === false; return types[type] === false && type !== rewards.TYPE_FEATURED_DOWNLOAD; //handled below
}) })
if (unclaimedType) { if (unclaimedType) {
rewards.claimReward(unclaimedType); rewards.claimReward(unclaimedType);
} }
if (types[rewards.TYPE_FEATURED_DOWNLOAD] === false) {
rewards.claimReward(rewards.TYPE_FEATURED_DOWNLOAD)
}
}, () => { }); }, () => { });
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "lbry-web-ui", "name": "lbry-web-ui",
"version": "0.11.3", "version": "0.11.4",
"description": "LBRY UI", "description": "LBRY UI",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",