diff --git a/README.md b/README.md index c2b0af5a7..e446b747a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is a graphical browser for the decentralized content marketplace provided by the [LBRY](https://lbry.io) protocol. It is essentially the [lbry daemon](https://github.com/lbryio/lbry) bundled with a UI using [Electron](http://electron.atom.io/). + + ## Installing We provide installers for Windows, macOS, and Debian-based Linux. @@ -18,26 +20,24 @@ To install from source or make changes to the application, continue reading belo ## Development -This repo uses submodules, so clone it using `--recursive`. +### One-time Setup -### Setup +1. Install node and npm. +2. Check out this repo. +3. Set up a Python virtual environment, or live on the wild side. +4. Run `./build.sh`. This builds the UI assets and puts them into `app/dist`. It also downloads [lbry daemon](https://github.com/lbryio/lbry/releases). -The -[lbry daemon](https://github.com/lbryio/lbry/blob/master/INSTALL.md) needs -to be installed along with pyinstaller. You also need to be -able to build the lbry-web-ui, so have node, webpack, etc installed. +### Running -### Build +Run `./node_modules/.bin/electron app` -run `./build.sh` +### Ongoing Development +1. `cd ui` +2. `./watch.sh` -This builds the UI assets and puts them into `app/dist`. It also builds `app/dist/lbrynet-daemon`. +This will set up a monitor that will automatically compile any changes to JS or CSS folders inside of the `ui` folder. This allows you to make changes and see them immediately by reloading the app. -### Run - -`./node_modules/.bin/electron app` - -### Package +### Packaging We use [electron-builder](https://github.com/electron-userland/electron-builder) to create distributable packages, which is run by calling: diff --git a/ui/js/actions/app.js b/ui/js/actions/app.js index a513b820c..bf0451c82 100644 --- a/ui/js/actions/app.js +++ b/ui/js/actions/app.js @@ -52,6 +52,7 @@ export function doChangePath(path) { const state = getState() const pageTitle = selectPageTitle(state) window.document.title = pageTitle + window.scrollTo(0, 0) const currentPage = selectCurrentPage(state) if (currentPage === 'search') { diff --git a/ui/js/actions/content.js b/ui/js/actions/content.js index e6b6a30a1..a7276abf9 100644 --- a/ui/js/actions/content.js +++ b/ui/js/actions/content.js @@ -166,6 +166,8 @@ export function doDownloadFile(uri, streamInfo) { fileInfo, } }) + + dispatch(doUpdateLoadStatus(uri, streamInfo.outpoint)) }) lbryio.call('file', 'view', { @@ -176,7 +178,6 @@ export function doDownloadFile(uri, streamInfo) { rewards.claimEligiblePurchaseRewards() - dispatch(doUpdateLoadStatus(uri, streamInfo.outpoint)) } } diff --git a/ui/js/component/fileActions/index.js b/ui/js/component/fileActions/index.js index 8e9555a14..1d8ba6088 100644 --- a/ui/js/component/fileActions/index.js +++ b/ui/js/component/fileActions/index.js @@ -43,6 +43,7 @@ const makeSelect = () => { const selectIsAvailableForUri = makeSelectIsAvailableForUri() const selectDownloadingForUri = makeSelectDownloadingForUri() const selectCostInfoForUri = makeSelectCostInfoForUri() + const selectLoadingForUri = makeSelectLoadingForUri() const select = (state, props) => ({ fileInfo: selectFileInfoForUri(state, props), @@ -51,6 +52,7 @@ const makeSelect = () => { modal: selectCurrentModal(state), downloading: selectDownloadingForUri(state, props), costInfo: selectCostInfoForUri(state, props), + loading: selectLoadingForUri(state, props), }) return select diff --git a/ui/js/component/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx index 0a2106b26..0d45514f7 100644 --- a/ui/js/component/fileActions/view.jsx +++ b/ui/js/component/fileActions/view.jsx @@ -63,6 +63,7 @@ class FileActions extends React.Component { closeModal, startDownload, costInfo, + loading, } = this.props const deleteChecked = this.state.deleteChecked, @@ -73,7 +74,7 @@ class FileActions extends React.Component { let content - if (downloading) { + if (loading || downloading) { const progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0, @@ -110,7 +111,6 @@ class FileActions extends React.Component { content = openInShell(fileInfo)} />; } else { console.log('handle this case of file action props?'); - console.log(this.props) } return ( diff --git a/ui/js/component/video/index.js b/ui/js/component/video/index.js index 423ff533a..e581f4bc6 100644 --- a/ui/js/component/video/index.js +++ b/ui/js/component/video/index.js @@ -13,7 +13,8 @@ import { doLoadVideo, } from 'actions/content' import { - makeSelectMetadataForUri + makeSelectMetadataForUri, + makeSelectContentTypeForUri, } from 'selectors/claims' import { makeSelectFileInfoForUri, @@ -32,6 +33,7 @@ const makeSelect = () => { const selectIsLoading = makeSelectLoadingForUri() const selectIsDownloading = makeSelectDownloadingForUri() const selectMetadata = makeSelectMetadataForUri() + const selectContentType = makeSelectContentTypeForUri() const select = (state, props) => ({ costInfo: selectCostInfo(state, props), @@ -40,6 +42,7 @@ const makeSelect = () => { modal: selectCurrentModal(state), isLoading: selectIsLoading(state, props), isDownloading: selectIsDownloading(state, props), + contentType: selectContentType(state, props), }) return select diff --git a/ui/js/component/video/view.jsx b/ui/js/component/video/view.jsx index b3601a287..3284c4d46 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -2,6 +2,10 @@ import React from 'react'; import FilePrice from 'component/filePrice' import Link from 'component/link'; import Modal from 'component/modal'; +import lbry from 'lbry' +import { + Thumbnail, +} from 'component/common' class VideoPlayButton extends React.Component { onPurchaseConfirmed() { @@ -33,6 +37,7 @@ class VideoPlayButton extends React.Component { isLoading, costInfo, fileInfo, + mediaType, } = this.props /* @@ -44,13 +49,14 @@ class VideoPlayButton extends React.Component { */ const disabled = isLoading || fileInfo === undefined || (fileInfo === null && (!costInfo || costInfo.cost === undefined)) + const icon = mediaType == "image" ? "icon-folder-o" : "icon-play" return (