From 9b199565b0bd8a3e6efcd5e32cae36a08835c76a Mon Sep 17 00:00:00 2001 From: seanyesmunt Date: Wed, 22 Aug 2018 15:54:52 -0400 Subject: [PATCH 1/7] don't record file twice if user clicked 'download' before 'play' --- src/renderer/component/fileViewer/internal/player.jsx | 1 + src/renderer/component/fileViewer/view.jsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/component/fileViewer/internal/player.jsx b/src/renderer/component/fileViewer/internal/player.jsx index 8d3bf07b9..d76d0bcaf 100644 --- a/src/renderer/component/fileViewer/internal/player.jsx +++ b/src/renderer/component/fileViewer/internal/player.jsx @@ -46,6 +46,7 @@ class MediaPlayer extends React.PureComponent { const loadedMetadata = () => { this.setState({ hasMetadata: true, startedPlaying: true }); + if (startedPlayingCb) { startedPlayingCb(); } diff --git a/src/renderer/component/fileViewer/view.jsx b/src/renderer/component/fileViewer/view.jsx index 57cab3463..aed32f07c 100644 --- a/src/renderer/component/fileViewer/view.jsx +++ b/src/renderer/component/fileViewer/view.jsx @@ -146,7 +146,12 @@ class FileViewer extends React.PureComponent { } playContent() { - const { play, uri } = this.props; + const { play, uri, fileInfo, isDownloading, isLoading } = this.props; + + if (fileInfo || isDownloading || isLoading) { + // User may have pressed download before clicking play + this.startedPlayingCb = null; + } if (this.startedPlayingCb) { this.startTime = Date.now(); From 3694104b0d91612dfe16a818c270759a773f7699 Mon Sep 17 00:00:00 2001 From: seanyesmunt Date: Thu, 23 Aug 2018 00:37:26 -0400 Subject: [PATCH 2/7] fix: sorting on subscriptions with multiple claims in same block --- src/renderer/component/fileList/view.jsx | 33 ++++++++---------------- src/renderer/types/file_info.js | 19 ++++++++++++++ 2 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 src/renderer/types/file_info.js diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index c071e6c31..9ab572663 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -3,23 +3,7 @@ import * as React from 'react'; import { buildURI } from 'lbry-redux'; import { FormField } from 'component/common/form'; import FileCard from 'component/fileCard'; - -type FileInfo = { - name: string, - channelName: ?string, - pending?: boolean, - channel_claim_id: string, - value?: { - publisherSignature: { - certificateId: string, - }, - }, - metadata: { - publisherSignature: { - certificateId: string, - }, - }, -}; +import type { FileInfo } from 'types/file_info'; type Props = { hideFilter: boolean, @@ -50,7 +34,7 @@ class FileList extends React.PureComponent { this.sortFunctions = { dateNew: fileInfos => this.props.sortByHeight - ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { + ? fileInfos.sort((fileInfo1, fileInfo2) => { if (fileInfo1.pending) { return -1; } @@ -60,11 +44,16 @@ class FileList extends React.PureComponent { const height2 = this.props.claimsById[fileInfo2.claim_id] ? this.props.claimsById[fileInfo2.claim_id].height : 0; - if (height1 > height2) { - return -1; - } else if (height1 < height2) { - return 1; + + if (height1 !== height2) { + // flipped because heigher block height is newer + return height2 - height1; } + + if (fileInfo1.absolute_channel_position && fileInfo2.absolute_channel_position) { + return fileInfo1.absolute_channel_position - fileInfo2.absolute_channel_position; + } + return 0; }) : [...fileInfos].reverse(), diff --git a/src/renderer/types/file_info.js b/src/renderer/types/file_info.js new file mode 100644 index 000000000..82a9d90b4 --- /dev/null +++ b/src/renderer/types/file_info.js @@ -0,0 +1,19 @@ +// @flow + +export type FileInfo = { + absolute_channel_position: ?number, + name: string, + channelName: ?string, + pending?: boolean, + channel_claim_id: string, + value?: { + publisherSignature: { + certificateId: string, + }, + }, + metadata: { + publisherSignature: { + certificateId: string, + }, + }, +}; From 0ec7a30ccd952b318fd6a8a20779473cd0c3cbfc Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 22 Aug 2018 12:40:44 -0400 Subject: [PATCH 3/7] fix: show email after refreshing the app --- src/renderer/redux/actions/app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index 63930954d..7b6e2cc31 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -28,6 +28,7 @@ import { selectRemoteVersion, selectUpgradeTimer, } from 'redux/selectors/app'; +import { doAuthenticate } from 'redux/actions/user'; import { lbrySettings as config } from 'package.json'; const { autoUpdater } = remote.require('electron-updater'); @@ -336,6 +337,7 @@ export function doDaemonReady() { return (dispatch, getState) => { const state = getState(); + dispatch(doAuthenticate()); dispatch({ type: ACTIONS.DAEMON_READY }); dispatch(doFetchDaemonSettings()); dispatch(doBalanceSubscribe()); From 89162a179bdf942811f01830fdd5ed22d3b8725a Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 24 Aug 2018 00:55:09 -0400 Subject: [PATCH 4/7] chore: bump rc + daemon and fixed/added to changelog --- CHANGELOG.md | 29 ++++++++++++++++++----------- package.json | 4 ++-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed4a49eb..72b7bc2b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,24 +6,32 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ## [Unreleased] ### Added - * Wallet Encryption/Decryption user flows ([#1785](https://github.com/lbryio/lbry-desktop/pull/1785)) - * Add FAQ to Publishing Area ([#1833](https://github.com/lbryio/lbry-desktop/pull/1833)) + * Wallet encryption/decryption user flows in settings ([#1785](https://github.com/lbryio/lbry-desktop/pull/1785)) + * Suggestions for recommended content on file page ([#1845](https://github.com/lbryio/lbry-desktop/pull/1845)) + * Auto download setting for subscriptions ([#1898](https://github.com/lbryio/lbry-desktop/pull/1898)) + * Ability to disable desktop notifications ([#1834](https://github.com/lbryio/lbry-desktop/pull/1834)) * Better preview for content ([#620](https://github.com/lbryio/lbry-desktop/pull/620)) * New markdown and docx viewer ([#1826](https://github.com/lbryio/lbry-desktop/pull/1826)) * New viewer for human-readable text files ([#1826](https://github.com/lbryio/lbry-desktop/pull/1826)) * CSV and JSON viewer ([#1410](https://github.com/lbryio/lbry-desktop/pull/1410)) - * Recommended content on file viewer page ([#1845](https://github.com/lbryio/lbry-desktop/pull/1845)) - * 3D File viewer improvements ([#1870](https://github.com/lbryio/lbry-desktop/pull/1870)) + * 3D File viewer features and performance/memory usage improvements ([#1870](https://github.com/lbryio/lbry-desktop/pull/1870)) * Desktop notification when publish is completed ([#1892](https://github.com/lbryio/lbry-desktop/pull/1892)) + * FAQ to Publishing Area ([#1833](https://github.com/lbryio/lbry-desktop/pull/1833)) ### Changed -* Pass error message from spee.ch API during thumbnail upload ([#1840](https://github.com/lbryio/lbry-desktop/pull/1840)) -* Use router pattern for rendering file viewer ([#1544](https://github.com/lbryio/lbry-desktop/pull/1544)) -* Missing word "to" added to the Bid Help Text (#1854) -* Updated to electron@2 ([#1858](https://github.com/lbryio/lbry-desktop/pull/1858)) + * Upgraded LBRY Protocol to [version 0.21.2](https://github.com/lbryio/lbry/releases/tag/v0.21.2) fixing a download bug. + * Searching now shows results by default, including direct lbry:// URL tile + * Replaced checkboxes with toggles throughout app ([#1834](https://github.com/lbryio/lbry-desktop/pull/1834)) + * Removed price tile when content is Free ([#1845](https://github.com/lbryio/lbry-desktop/pull/1845)) + * Pass error message from spee.ch API during thumbnail upload ([#1840](https://github.com/lbryio/lbry-desktop/pull/1840)) + * Use router pattern for rendering file viewer ([#1544](https://github.com/lbryio/lbry-desktop/pull/1544)) + * Missing word "to" added to the Bid Help Text (#1854) + * Updated to electron@2 ([#1858](https://github.com/lbryio/lbry-desktop/pull/1858)) ### Fixed - + * Node id not being passed correctly ([#1895](https://github.com/lbryio/lbry-desktop/pull/1895)) + * Subscription quirks including not loading on startup, sorting, showing new content, and sub blank page ([#1872](https://github.com/lbryio/lbry-desktop/pull/1872)) + * Upgrade on Close button not dismissing properly during automated app update ([#1857](https://github.com/lbryio/lbry-desktop/pull/1857)) ## [0.24.0] - 2018-08-14 @@ -54,7 +62,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * Abandoned claim transactions now show in wallet history ([#1769](https://github.com/lbryio/lbry-desktop/pull/1769)) * Emoji support in the claim description ([#1800](https://github.com/lbryio/lbry-desktop/pull/1800)) * PDF preview ([#1576](https://github.com/lbryio/lbry-desktop/pull/1576)) - * Add Desktop notification settings to be enabled/disabled ([#1834](https://github.com/lbryio/lbry-desktop/pull/1834)) ### Changed * Upgraded LBRY Protocol to [version 0.20.4](https://github.com/lbryio/lbry/releases/tag/v0.20.4) to assist with download availability and lower CPU usage on idle. @@ -65,7 +72,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * Hide the "Community top bids" section if user chooses to hide NSFW content ([#1760](https://github.com/lbryio/lbry-desktop/pull/1760)) * More descriptive error message when Shapeshift is unavailable ([#1771](https://github.com/lbryio/lbry-desktop/pull/1771)) * Rename the Github repo to lbry-desktop ([#1765](https://github.com/lbryio/lbry-desktop/pull/1765)) - * Changed default browser checkbox to use toggle on all checkbox inputs ([#1834](https://github.com/lbryio/lbry-desktop/pull/1834)) + ### Fixed * Edit option missing from certain published claims ([#1756](https://github.com/lbryio/lbry-desktop/issues/1756)) diff --git a/package.json b/package.json index a7d9e7bfe..5395917c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.25.0-rc.1", + "version": "0.25.0-rc.2", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" @@ -133,7 +133,7 @@ "yarn": "^1.3" }, "lbrySettings": { - "lbrynetDaemonVersion": "0.21.1", + "lbrynetDaemonVersion": "0.21.2", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-daemon-vDAEMONVER-OSNAME.zip", "lbrynetDaemonDir": "static/daemon", "lbrynetDaemonFileName": "lbrynet-daemon" From e7a2bb1bbaaba5899b73eebe042e48c33e5d6c82 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 27 Aug 2018 19:04:27 -0400 Subject: [PATCH 5/7] 0.25.0-rc.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f0d57ac2..d8504ccca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.25.0-rc.2", + "version": "0.25.0-rc.3", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From f900f53056478e6f105fa55f9949ef5652cfb6f8 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 28 Aug 2018 00:19:26 -0400 Subject: [PATCH 6/7] don't show notification for new subscription if on subscription page --- src/renderer/redux/actions/subscriptions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/renderer/redux/actions/subscriptions.js b/src/renderer/redux/actions/subscriptions.js index d677d51a6..2b13840e2 100644 --- a/src/renderer/redux/actions/subscriptions.js +++ b/src/renderer/redux/actions/subscriptions.js @@ -7,7 +7,7 @@ import type { Dispatch, SubscriptionNotifications } from 'redux/reducers/subscri import type { Subscription } from 'types/subscription'; import { selectSubscriptions } from 'redux/selectors/subscriptions'; import { makeSelectClientSetting } from 'redux/selectors/settings'; -import { Lbry, buildURI, parseURI } from 'lbry-redux'; +import { Lbry, buildURI, parseURI, selectCurrentPage } from 'lbry-redux'; import { doPurchaseUri, doFetchClaimsByChannel } from 'redux/actions/content'; import { doClaimRewardType } from 'redux/actions/rewards'; import Promise from 'bluebird'; @@ -133,6 +133,7 @@ export const doCheckSubscription = (subscriptionUri: string, notify?: boolean) = // no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on const state = getState(); + const currentPage = selectCurrentPage(state); const savedSubscription = state.subscriptions.subscriptions.find( sub => sub.uri === subscriptionUri ); @@ -141,6 +142,11 @@ export const doCheckSubscription = (subscriptionUri: string, notify?: boolean) = const claimResult = result[subscriptionUri] || {}; const { claims_in_channel: claimsInChannel } = claimResult; + // may happen if subscribed to an abandoned channel or an empty channel + if (!claimsInChannel) { + return; + } + const latestIndex = claimsInChannel.findIndex( claim => `${claim.name}#${claim.claim_id}` === savedSubscription.latest ); @@ -158,7 +164,7 @@ export const doCheckSubscription = (subscriptionUri: string, notify?: boolean) = !claim.value.stream.metadata.fee && makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state) ); - if (notify) { + if (notify && currentPage !== 'subscriptions') { dispatch( setSubscriptionNotification( savedSubscription, From e608d36d02cbbf787fc512c02d8965a6ff9f8dec Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 28 Aug 2018 10:40:03 -0400 Subject: [PATCH 7/7] chore: bump lbry-redux to latest commit from the PR --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8504ccca..3c1021c16 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#feffbe966fc568cef595ab66b314766261e855df", + "lbry-redux": "lbryio/lbry-redux#eae0d134d92d83f733b85a8ecebf529a6e9799cf", "localforage": "^1.7.1", "mammoth": "^1.4.6", "mime": "^2.3.1",