From c65dfddfe181c074fd46845b24ee437cb90653a3 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Wed, 6 Feb 2019 03:04:55 -0500 Subject: [PATCH] maint: 0.31.0 changes Changes to account for 0.31.0, WIP --- package.json | 2 +- src/renderer/component/fileDetails/view.jsx | 6 +++++- src/renderer/page/file/view.jsx | 7 +++---- src/renderer/page/settings/view.jsx | 6 +++--- src/renderer/redux/actions/publish.js | 12 +++--------- src/renderer/redux/actions/settings.js | 7 +++++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 595e8be7b..10912e2cc 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "yarn": "^1.3" }, "lbrySettings": { - "lbrynetDaemonVersion": "0.30.4", + "lbrynetDaemonVersion": "0.31.0rc5", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip", "lbrynetDaemonDir": "static/daemon", "lbrynetDaemonFileName": "lbrynet" diff --git a/src/renderer/component/fileDetails/view.jsx b/src/renderer/component/fileDetails/view.jsx index aa2eb9f5b..dba36a95a 100644 --- a/src/renderer/component/fileDetails/view.jsx +++ b/src/renderer/component/fileDetails/view.jsx @@ -62,7 +62,11 @@ class FileDetails extends PureComponent { const { description, language, license } = metadata; const mediaType = contentType || 'unknown'; - const downloadPath = fileInfo ? path.normalize(fileInfo.download_path) : null; + let downloadPath = + fileInfo && fileInfo.download_path ? path.normalize(fileInfo.download_path) : null; + // We should check if the file exists, and then show a better message, wtih an option to redownload. + if (fileInfo && fileInfo.download_path === null) + downloadPath = 'File may have been deleted or moved.'; return ( diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx index 56bcd5392..9ae5a7a85 100644 --- a/src/renderer/page/file/view.jsx +++ b/src/renderer/page/file/view.jsx @@ -58,15 +58,14 @@ class FilePage extends React.Component { ]; componentDidMount() { + // eslint-disable-next-line no-unused-vars const { uri, fileInfo, fetchFileInfo, fetchCostInfo, setViewed, isSubscribed } = this.props; if (isSubscribed) { this.removeFromSubscriptionNotifications(); } - - if (fileInfo === undefined) { - fetchFileInfo(uri); - } + // always refresh file info when entering file page + fetchFileInfo(uri); // See https://github.com/lbryio/lbry-desktop/pull/1563 for discussion fetchCostInfo(uri); diff --git a/src/renderer/page/settings/view.jsx b/src/renderer/page/settings/view.jsx index bb821cdd7..af72f882f 100644 --- a/src/renderer/page/settings/view.jsx +++ b/src/renderer/page/settings/view.jsx @@ -13,7 +13,7 @@ export type Price = { }; type DaemonSettings = { - download_directory: string, + download_dir: string, disable_max_key_fee: boolean, share_usage_data: boolean, max_key_fee?: Price, @@ -80,7 +80,7 @@ class SettingsPage extends React.PureComponent { } onDownloadDirChange(newDirectory: string) { - this.setDaemonSetting('download_directory', newDirectory); + this.setDaemonSetting('download_dir', newDirectory); } onKeyFeeChange(newValue: Price) { @@ -190,7 +190,7 @@ class SettingsPage extends React.PureComponent {
diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index feda7b504..7c7d556e4 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -1,6 +1,6 @@ // @flow import type { Dispatch, GetState } from 'types/redux'; -import type { Source, Metadata } from 'types/claim'; +import type { Metadata } from 'types/claim'; import type { UpdatePublishFormData, UpdatePublishFormAction, @@ -226,7 +226,6 @@ export const doPublish = (params: PublishParams) => ( contentIsFree, price, uri, - sources, } = params; // get the claim id from the channel name, we will use that instead @@ -250,7 +249,6 @@ export const doPublish = (params: PublishParams) => ( bid: ?number, metadata: ?Metadata, file_path?: string, - sources?: Source, } = { name, channel_id: channelId, @@ -264,12 +262,8 @@ export const doPublish = (params: PublishParams) => ( amount: creditsToString(fee.amount), }; } - - if (filePath) { - publishPayload.file_path = filePath; - } else { - publishPayload.sources = sources; - } + // only pass file on new uploads, not metadata only edits. + if (filePath) publishPayload.file_path = filePath; dispatch({ type: ACTIONS.PUBLISH_START }); diff --git a/src/renderer/redux/actions/settings.js b/src/renderer/redux/actions/settings.js index 08a4626ae..5ce87f9bc 100644 --- a/src/renderer/redux/actions/settings.js +++ b/src/renderer/redux/actions/settings.js @@ -22,8 +22,10 @@ export function doFetchDaemonSettings() { export function doSetDaemonSetting(key, value) { return dispatch => { - const newSettings = {}; - newSettings[key] = value; + const newSettings = { + key, + value, + }; Lbry.settings_set(newSettings).then(newSettings); Lbry.settings_get().then(settings => { analytics.toggle(settings.share_usage_data, true); @@ -71,6 +73,7 @@ export function doUpdateIsNight() { export function doUpdateIsNightAsync() { return dispatch => { dispatch(doUpdateIsNight()); + // eslint-disable-next-line no-unused-vars const updateIsNightInterval = setInterval( () => dispatch(doUpdateIsNight()), UPDATE_IS_NIGHT_INTERVAL