From 1a3615cddba989703da1fae3925fdac30f1a801c Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Wed, 14 Aug 2019 14:47:57 -0400 Subject: [PATCH 1/3] fix: publish bugs Fixes files being passed on edit + tags not repopulating. --- dist/bundle.es.js | 15 ++++----------- src/redux/actions/publish.js | 11 ++--------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index aeb5956..8cd3dd8 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -3044,7 +3044,8 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => { license, license_url: licenseUrl, thumbnail, - title + title, + tags } = value; const publishData = { @@ -3060,7 +3061,8 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => { uri, uploadThumbnailStatus: thumbnail ? MANUAL : undefined, licenseUrl, - nsfw: isClaimNsfw(claim) + nsfw: isClaimNsfw(claim), + tags: tags ? tags.map(tag => ({ name: tag })) : [] }; // Make sure custom licenses are mapped properly @@ -3082,15 +3084,6 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => { publishData['channel'] = channelName; } - if (fs && fileInfo && fileInfo.download_path) { - try { - fs.accessSync(fileInfo.download_path, fs.constants.R_OK); - publishData.filePath = fileInfo.download_path; - } catch (e) { - console.error(e.name, e.message); - } - } - dispatch({ type: DO_PREPARE_EDIT, data: publishData }); }; diff --git a/src/redux/actions/publish.js b/src/redux/actions/publish.js index 6c23373..5db20c9 100644 --- a/src/redux/actions/publish.js +++ b/src/redux/actions/publish.js @@ -189,6 +189,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis license_url: licenseUrl, thumbnail, title, + tags, } = value; const publishData: UpdatePublishFormData = { @@ -205,6 +206,7 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined, licenseUrl, nsfw: isClaimNsfw(claim), + tags: tags ? tags.map(tag => ({ name: tag })) : [], }; // Make sure custom licenses are mapped properly @@ -226,15 +228,6 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis publishData['channel'] = channelName; } - if (fs && fileInfo && fileInfo.download_path) { - try { - fs.accessSync(fileInfo.download_path, fs.constants.R_OK); - publishData.filePath = fileInfo.download_path; - } catch (e) { - console.error(e.name, e.message); - } - } - dispatch({ type: ACTIONS.DO_PREPARE_EDIT, data: publishData }); }; -- 2.45.3 From 6005fa245a888e2de045d7e42411847de7943f52 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Wed, 14 Aug 2019 18:22:50 -0400 Subject: [PATCH 2/3] fix: streaming + downloads Allows you to download while streaming + re-download already streamed content if it was deleted or settings changed. --- dist/bundle.es.js | 2 +- src/redux/actions/file.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index baa40ce..79ea5d8 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2730,7 +2730,7 @@ function doPurchaseUri(uri, costInfo, saveFile = true, onSuccess) { const alreadyDownloading = fileInfo && !!downloadingByOutpoint[fileInfo.outpoint]; const alreadyStreaming = makeSelectStreamingUrlForUri(uri)(state); - if (alreadyDownloading || alreadyStreaming) { + if (!saveFile && (alreadyDownloading || alreadyStreaming)) { dispatch({ type: PURCHASE_URI_FAILED, data: { uri, error: `Already fetching uri: ${uri}` } diff --git a/src/redux/actions/file.js b/src/redux/actions/file.js index 79d9b99..f6befff 100644 --- a/src/redux/actions/file.js +++ b/src/redux/actions/file.js @@ -95,7 +95,7 @@ export function doPurchaseUri( const alreadyDownloading = fileInfo && !!downloadingByOutpoint[fileInfo.outpoint]; const alreadyStreaming = makeSelectStreamingUrlForUri(uri)(state); - if (alreadyDownloading || alreadyStreaming) { + if (!saveFile && (alreadyDownloading || alreadyStreaming)) { dispatch({ type: ACTIONS.PURCHASE_URI_FAILED, data: { uri, error: `Already fetching uri: ${uri}` }, -- 2.45.3 From 027c517ec653f328eeed2cf509b1062b0f787f22 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 14 Aug 2019 23:47:04 -0400 Subject: [PATCH 3/3] update for 0.38.7 account_balance api changes --- dist/bundle.es.js | 4 ++-- src/redux/actions/wallet.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index baa40ce..049f588 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1750,8 +1750,8 @@ function doUpdateBalance() { const { wallet: { balance: balanceInStore } } = getState(); - lbryProxy.account_balance().then(balanceAsString => { - const balance = parseFloat(balanceAsString); + lbryProxy.account_balance().then(({ available }) => { + const balance = parseFloat(available); if (balanceInStore !== balance) { dispatch({ type: UPDATE_BALANCE, diff --git a/src/redux/actions/wallet.js b/src/redux/actions/wallet.js index 475436f..8757422 100644 --- a/src/redux/actions/wallet.js +++ b/src/redux/actions/wallet.js @@ -10,8 +10,8 @@ export function doUpdateBalance() { const { wallet: { balance: balanceInStore }, } = getState(); - Lbry.account_balance().then(balanceAsString => { - const balance = parseFloat(balanceAsString); + Lbry.account_balance().then(({ available }) => { + const balance = parseFloat(available); if (balanceInStore !== balance) { dispatch({ type: ACTIONS.UPDATE_BALANCE, -- 2.45.3