diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b541729bc..8403ec135 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.11.3 +current_version = 0.11.4 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+)(?P\d+))? diff --git a/CHANGELOG.md b/CHANGELOG.md index e640b44c9..1a7f237d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ### Fixed diff --git a/app/package.json b/app/package.json index d00c85f0a..a3c2e86fd 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.11.3", + "version": "0.11.4", "main": "main.js", "description": "LBRY is a fully decentralized, open-source protocol facilitating the discovery, access, and (sometimes) purchase of data.", "author": { diff --git a/ui/js/actions/content.js b/ui/js/actions/content.js index 0e7366dca..023a3c65a 100644 --- a/ui/js/actions/content.js +++ b/ui/js/actions/content.js @@ -122,7 +122,6 @@ export function doUpdateLoadStatus(uri, outpoint) { } else if (fileInfo.completed) { // TODO this isn't going to get called if they reload the client before // the download finished - rewards.claimNextPurchaseReward() dispatch({ type: types.DOWNLOADING_COMPLETED, data: { @@ -172,8 +171,11 @@ export function doDownloadFile(uri, streamInfo) { lbryio.call('file', 'view', { uri: uri, outpoint: streamInfo.outpoint, - claimId: streamInfo.claim_id, + claim_id: streamInfo.claim_id, }).catch(() => {}) + + rewards.claimEligiblePurchaseRewards() + dispatch(doUpdateLoadStatus(uri, streamInfo.outpoint)) } } diff --git a/ui/js/page/filePage/index.js b/ui/js/page/filePage/index.js index f61a3e803..4dae3db60 100644 --- a/ui/js/page/filePage/index.js +++ b/ui/js/page/filePage/index.js @@ -11,6 +11,9 @@ import { import { makeSelectFileInfoForUri, } from 'selectors/file_info' +import { + doFetchCostInfoForUri, +} from 'actions/cost_info' import { makeSelectClaimForUri, makeSelectContentTypeForUri, @@ -41,7 +44,8 @@ const makeSelect = () => { const perform = (dispatch) => ({ 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) diff --git a/ui/js/page/filePage/view.jsx b/ui/js/page/filePage/view.jsx index 660b8a366..87c96c0cd 100644 --- a/ui/js/page/filePage/view.jsx +++ b/ui/js/page/filePage/view.jsx @@ -46,6 +46,7 @@ class FilePage extends React.Component{ componentDidMount() { this.fetchFileInfo(this.props) + this.fetchCostInfo(this.props) } componentWillReceiveProps(nextProps) { @@ -58,6 +59,12 @@ class FilePage extends React.Component{ } } + fetchCostInfo(props) { + if (props.costInfo === undefined) { + props.fetchCostInfo(props.uri) + } + } + render() { const { claim, diff --git a/ui/js/rewards.js b/ui/js/rewards.js index 6e08ca11d..c090951ce 100644 --- a/ui/js/rewards.js +++ b/ui/js/rewards.js @@ -76,6 +76,7 @@ rewards.TYPE_FIRST_CHANNEL = "new_channel", rewards.TYPE_FIRST_STREAM = "first_stream", rewards.TYPE_MANY_DOWNLOADS = "many_downloads", rewards.TYPE_FIRST_PUBLISH = "first_publish"; +rewards.TYPE_FEATURED_DOWNLOAD = "featured_download"; rewards.claimReward = function (type) { @@ -155,9 +156,10 @@ rewards.claimReward = function (type) { }); } -rewards.claimNextPurchaseReward = function() { +rewards.claimEligiblePurchaseRewards = function() { let types = {} types[rewards.TYPE_FIRST_STREAM] = false + types[rewards.TYPE_FEATURED_DOWNLOAD] = false types[rewards.TYPE_MANY_DOWNLOADS] = false lbryio.call('reward', 'list', {}).then((userRewards) => { userRewards.forEach((reward) => { @@ -166,11 +168,14 @@ rewards.claimNextPurchaseReward = function() { } }) let unclaimedType = Object.keys(types).find((type) => { - return types[type] === false; + return types[type] === false && type !== rewards.TYPE_FEATURED_DOWNLOAD; //handled below }) if (unclaimedType) { rewards.claimReward(unclaimedType); } + if (types[rewards.TYPE_FEATURED_DOWNLOAD] === false) { + rewards.claimReward(rewards.TYPE_FEATURED_DOWNLOAD) + } }, () => { }); } diff --git a/ui/package.json b/ui/package.json index bf2d03720..7ee6d6272 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "lbry-web-ui", - "version": "0.11.3", + "version": "0.11.4", "description": "LBRY UI", "scripts": { "test": "echo \"Error: no test specified\" && exit 1",