diff --git a/dist/bundle.es.js b/dist/bundle.es.js index a942c6a..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, @@ -2730,7 +2730,7 @@ function doPurchaseUri(uri, costInfo, saveFile = true, onSuccess) { const alreadyDownloading = fileInfo && !!downloadingByOutpoint[fileInfo.outpoint]; const alreadyStreaming = makeSelectStreamingUrlForUri(uri)(state); - if (!saveFile && (alreadyDownloading || alreadyStreaming)) { + if (alreadyDownloading || alreadyStreaming) { dispatch({ type: PURCHASE_URI_FAILED, data: { uri, error: `Already fetching uri: ${uri}` } @@ -3041,8 +3041,7 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => { license, license_url: licenseUrl, thumbnail, - title, - tags + title } = value; const publishData = { @@ -3058,8 +3057,7 @@ const doPrepareEdit = (claim, uri, fileInfo, fs) => dispatch => { uri, uploadThumbnailStatus: thumbnail ? MANUAL : undefined, licenseUrl, - nsfw: isClaimNsfw(claim), - tags: tags ? tags.map(tag => ({ name: tag })) : [] + nsfw: isClaimNsfw(claim) }; // Make sure custom licenses are mapped properly @@ -3081,6 +3079,15 @@ 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/file.js b/src/redux/actions/file.js index f6befff..79d9b99 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 (!saveFile && (alreadyDownloading || alreadyStreaming)) { + if (alreadyDownloading || alreadyStreaming) { dispatch({ type: ACTIONS.PURCHASE_URI_FAILED, data: { uri, error: `Already fetching uri: ${uri}` }, diff --git a/src/redux/actions/publish.js b/src/redux/actions/publish.js index 5db20c9..6c23373 100644 --- a/src/redux/actions/publish.js +++ b/src/redux/actions/publish.js @@ -189,7 +189,6 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string, fileInfo: FileLis license_url: licenseUrl, thumbnail, title, - tags, } = value; const publishData: UpdatePublishFormData = { @@ -206,7 +205,6 @@ 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 @@ -228,6 +226,15 @@ 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 }); }; 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,