maint: 0.31.0 changes

Changes to account for 0.31.0, WIP
This commit is contained in:
Thomas Zarebczan 2019-02-06 03:04:55 -05:00
parent 0796e473b9
commit c65dfddfe1
6 changed files with 20 additions and 20 deletions

View file

@ -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"

View file

@ -62,7 +62,11 @@ class FileDetails extends PureComponent<Props> {
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 (
<Fragment>

View file

@ -58,15 +58,14 @@ class FilePage extends React.Component<Props> {
];
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);

View file

@ -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<Props, State> {
}
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<Props, State> {
<div className="card__content">
<FileSelector
type="openDirectory"
currentPath={daemonSettings.download_directory}
currentPath={daemonSettings.download_dir}
onFileChosen={this.onDownloadDirChange}
/>
</div>

View file

@ -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 });

View file

@ -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