allow claims to be updated and abandoned #595

Merged
daovist merged 46 commits from update-claims into master 2018-11-09 16:50:34 +01:00
60 changed files with 1080 additions and 280 deletions

View file

@ -14,6 +14,19 @@ export function clearFile () {
};
}
export function setUpdateTrue () {
kauffj commented 2018-09-25 15:25:52 +02:00 (Migrated from github.com)
Review

Is this necessary? My inclination is that there must be another state value corresponding to what is being edited (or even however you ended up on the edit page) that should allow you to know this without an additional explicit value.

Is this necessary? My inclination is that there must be another state value corresponding to what is being edited (or even however you ended up on the edit page) that should allow you to know this without an additional explicit value.
daovist commented 2018-09-25 19:44:01 +02:00 (Migrated from github.com)
Review

I think it would be more complex to do this another way e.g. looking at the router path

I think it would be more complex to do this another way e.g. looking at the router path
return {
type: actions.SET_UPDATE_TRUE,
};
}
export function setHasChanged (status) {
return {
type: actions.SET_HAS_CHANGED,
data: status,
};
}
export function updateMetadata (name, value) {
return {
type: actions.METADATA_UPDATE,
@ -31,6 +44,13 @@ export function updateClaim (value) {
};
};
export function abandonClaim (data) {
return {
type: actions.ABANDON_CLAIM,
data,
};
};
export function setPublishInChannel (channel) {
return {
type: actions.SET_PUBLISH_IN_CHANNEL,

View file

@ -105,6 +105,13 @@ export function updateAssetViewsInList (id, claimId, claimViews) {
};
}
export function removeAsset (data) {
return {
type: actions.ASSET_REMOVE,
data,
};
}
// channel actions
export function addNewChannelToChannelList (id, name, shortId, longId, claimsData) {
@ -129,7 +136,7 @@ export function onUpdateChannelClaims (channelKey, name, longId, page) {
export function updateChannelClaims (channelListId, claimsData) {
return {
type: actions.CHANNEL_CLAIMS_UPDATE_SUCCESS,
type: actions.CHANNEL_CLAIMS_UPDATE_SUCCEEDED,
data: {channelListId, claimsData},
};
}

View file

@ -42,3 +42,15 @@ export function getClaimViews (claimId) {
const url = `/api/claim/views/${claimId}`;
return Request(url);
}
kauffj commented 2018-09-25 15:27:36 +02:00 (Migrated from github.com)
Review

DRY

DRY
export function doAbandonClaim (claimId) {
const params = {
method : 'POST',
body : JSON.stringify({claimId}),
headers: new Headers({
'Content-Type': 'application/json',
}),
credentials: 'include',
};
return Request('/api/claim/abandon', params);
}

View file

@ -10,6 +10,7 @@ import ContentPageWrapper from '@pages/ContentPageWrapper';
import FourOhFourPage from '@pages/FourOhFourPage';
import MultisitePage from '@pages/MultisitePage';
import PopularPage from '@pages/PopularPage';
import EditPage from '@pages/EditPage';
const App = () => {
return (
@ -21,6 +22,7 @@ const App = () => {
<Route exact path='/login' component={LoginPage} />
<Route exact path='/multisite' component={MultisitePage} />
<Route exact path='/popular' component={PopularPage} />
<Route exact path='/edit/:identifier/:claim' component={EditPage} />
<Route exact path='/:identifier/:claim' component={ContentPageWrapper} />
<Route exact path='/:claim' component={ContentPageWrapper} />
<Route component={FourOhFourPage} />

View file

@ -1,8 +1,8 @@
import {buffers, END, eventChannel} from 'redux-saga';
export const makePublishRequestChannel = (fd) => {
export const makePublishRequestChannel = (fd, isUpdate) => {
return eventChannel(emitter => {
const uri = '/api/claim/publish';
const uri = `/api/claim/${isUpdate ? 'update' : 'publish'}`;
const xhr = new XMLHttpRequest();
// add event listeners
const onLoadStart = () => {
kauffj commented 2018-09-25 15:29:20 +02:00 (Migrated from github.com)
Review

I know you didn't add this, but you should know we can just use the Fetch API.

I know you didn't add this, but you should know we can just use the Fetch API.

View file

@ -2,11 +2,14 @@ import React from 'react';
import FormFeedbackDisplay from '@components/FormFeedbackDisplay';
import Row from '@components/Row';
const DropzoneInstructionsDisplay = ({fileError}) => {
const DropzoneInstructionsDisplay = ({fileError, message}) => {
if (!message) {
message = 'Drag & drop image or video here to publish';
}
return (
<div className={'dropzone-instructions-display'}>
<Row>
<p className={'text--large'}>Drag & drop image or video here to publish</p>
<p className={'text--large'}>{message}</p>
</Row>
<Row>
<p className={'text--small'}>OR</p>

View file

@ -10,7 +10,12 @@ class PublishPreview extends React.Component {
};
}
componentDidMount () {
this.setPreviewImageSource(this.props.file);
const { isUpdate, sourceUrl, file } = this.props;
if (isUpdate && sourceUrl) {
this.setState({ imgSource: sourceUrl });
} else {
this.setPreviewImageSource(file);
}
}
componentWillReceiveProps (newProps) {
if (newProps.file !== this.props.file) {
@ -54,8 +59,10 @@ class PublishPreview extends React.Component {
PublishPreview.propTypes = {
dimPreview: PropTypes.bool.isRequired,
file : PropTypes.object.isRequired,
file : PropTypes.object,
thumbnail : PropTypes.object,
isUpdate : PropTypes.bool,
sourceUrl : PropTypes.string,
};
export default PublishPreview;

View file

@ -16,7 +16,7 @@ const PublishLicenseInput = ({ handleSelect }) => {
className='select select--primary'
onChange={handleSelect}
>
<option value=' '>Unspecified</option>
<option value=''>Unspecified</option>
<option value='Public Domain'>Public Domain</option>
<option value='Creative Commons'>Creative Commons</option>
</select>

View file

@ -7,9 +7,11 @@ import Row from '@components/Row';
class PublishPreview extends React.Component {
render () {
const { isUpdate, uri } = this.props;
return (
<div>
<Row>
{isUpdate && uri && (<p className='text--extra-small'>{`Editing ${uri}`}</p>)}
<PublishTitleInput />
</Row>
<HorizontalSplit

View file

@ -0,0 +1 @@
export const SAVE = 'Everything not saved will be lost. Are you sure you want to leave this page?';

View file

@ -10,3 +10,6 @@ export const TOGGLE_METADATA_INPUTS = 'TOGGLE_METADATA_INPUTS';
export const THUMBNAIL_NEW = 'THUMBNAIL_NEW';
export const PUBLISH_START = 'PUBLISH_START';
export const CLAIM_AVAILABILITY = 'CLAIM_AVAILABILITY';
export const SET_UPDATE_TRUE = 'SET_UPDATE_TRUE';
export const ABANDON_CLAIM = 'ABANDON_CLAIM';
export const SET_HAS_CHANGED = 'SET_HAS_CHANGED';

View file

@ -1,5 +1,6 @@
export const LOAD_START = 'LOAD_START';
export const LOADING = 'LOADING';
kauffj commented 2018-09-25 15:29:53 +02:00 (Migrated from github.com)
Review

should be SUCCEEDED fwiw

should be `SUCCEEDED` fwiw
export const PUBLISHING = 'PUBLISHING';
export const SUCCESS = 'SUCCESS';
export const SUCCEEDED = 'SUCCEEDED';
export const FAILED = 'FAILED';
export const ABANDONING = 'ABANDONING';

View file

@ -11,12 +11,14 @@ export const REQUEST_LIST_ADD = 'REQUEST_LIST_ADD';
// asset actions
export const ASSET_ADD = 'ASSET_ADD';
export const ASSET_VIEWS_UPDATE = 'ASSET_VIEWS_UPDATE';
export const ASSET_UPDATE_CLAIMDATA = 'ASSET_UPDATE_CLAIMDATA';
export const ASSET_REMOVE = 'ASSET_REMOVE';
// channel actions
export const CHANNEL_ADD = 'CHANNEL_ADD';
export const CHANNEL_CLAIMS_UPDATE_ASYNC = 'CHANNEL_CLAIMS_UPDATE_ASYNC';
export const CHANNEL_CLAIMS_UPDATE_SUCCESS = 'CHANNEL_CLAIMS_UPDATE_SUCCESS';
export const CHANNEL_CLAIMS_UPDATE_SUCCEEDED = 'CHANNEL_CLAIMS_UPDATE_SUCCEEDED';
// asset/file display actions
export const FILE_REQUESTED = 'FILE_REQUESTED';

View file

@ -3,7 +3,8 @@ import View from './view';
import { fileRequested } from '../../actions/show';
import { selectAsset } from '../../selectors/show';
const mapStateToProps = ({ show }) => {
const mapStateToProps = (props) => {
const {show} = props;
// select error and status
const error = show.displayAsset.error;
const status = show.displayAsset.status;

View file

@ -2,6 +2,42 @@ import React from 'react';
import Row from '@components/Row';
import ProgressBar from '@components/ProgressBar';
import { LOCAL_CHECK, UNAVAILABLE, ERROR, AVAILABLE } from '../../constants/asset_display_states';
import createCanonicalLink from '../../../../utils/createCanonicalLink';
class AvailableContent extends React.Component {
kauffj commented 2018-09-25 15:30:44 +02:00 (Migrated from github.com)
Review

good refactor!

good refactor!
render () {
const {contentType, sourceUrl, name, thumbnail} = this.props;
switch (contentType) {
case 'image/jpeg':
case 'image/jpg':
case 'image/png':
case 'image/gif':
return (
<img
className='asset-image'
src={sourceUrl}
alt={name}
/>
);
case 'video/mp4':
return (
<video
className='asset-video'
controls poster={thumbnail}
>
<source
src={sourceUrl}
/>
<p>Your browser does not support the <code>video</code> element.</p>
</video>
);
default:
return (
<p>Unsupported content type</p>
);
}
}
}
class AssetDisplay extends React.Component {
componentDidMount () {
@ -9,8 +45,15 @@ class AssetDisplay extends React.Component {
this.props.onFileRequest(name, claimId);
}
render () {
const { status, error, asset: { claimData: { name, claimId, contentType, fileExt, thumbnail } } } = this.props;
const sourceUrl = `/${claimId}/${name}.${fileExt}`;
const { status, error, asset } = this.props;
const { name, claimData: { claimId, contentType, thumbnail, outpoint } } = asset;
// the outpoint is added to force the browser to re-download the asset after an update
// issue: https://github.com/lbryio/spee.ch/issues/607
let fileExt;
if (typeof contentType === 'string') {
fileExt = contentType.split('/')[1] || 'jpg';
}
const sourceUrl = `${createCanonicalLink({ asset: asset.claimData })}.${fileExt}?${outpoint}`;
return (
<div className={'asset-display'}>
{(status === LOCAL_CHECK) &&
@ -36,37 +79,12 @@ class AssetDisplay extends React.Component {
</div>
}
{(status === AVAILABLE) &&
(() => {
switch (contentType) {
case 'image/jpeg':
case 'image/jpg':
case 'image/png':
case 'image/gif':
return (
<img
className='asset-image'
src={sourceUrl}
alt={name}
/>
);
case 'video/mp4':
return (
<video
className='asset-video'
controls poster={thumbnail}
>
<source
src={sourceUrl}
/>
<p>Your browser does not support the <code>video</code> element.</p>
</video>
);
default:
return (
<p>Unsupported content type</p>
);
}
})()
<AvailableContent
contentType={contentType}
sourceUrl={sourceUrl}
name={name}
thumbnail={thumbnail}
/>
}
</div>
);

View file

@ -2,12 +2,20 @@ import { connect } from 'react-redux';
import View from './view';
import { selectAsset } from '../../selectors/show';
const mapStateToProps = ({ show }) => {
const mapStateToProps = (props) => {
const {show} = props;
// select asset
const asset = selectAsset(show);
const editable = Boolean(
asset &&
asset.claimData &&
asset.claimData.channelName &&
props.channel.loggedInChannel.name === asset.claimData.channelName
);
// return props
return {
asset,
editable,
};
};

View file

@ -13,10 +13,11 @@ import createCanonicalLink from '../../../../utils/createCanonicalLink';
class AssetInfo extends React.Component {
render () {
const { asset } = this.props;
const { claimViews, claimData: { channelName, channelShortId, description, name, fileExt, contentType, thumbnail, host } } = asset;
const { editable, asset } = this.props;
const { claimViews, claimData } = asset;
const { channelName, claimId, channelShortId, description, name, fileExt, contentType, host } = claimData;
const canonicalUrl = createCanonicalLink({ asset: { ...asset.claimData, shortId: asset.shortId }});
const canonicalUrl = createCanonicalLink({ asset: { ...claimData, shortId: asset.shortId }});
const assetCanonicalUrl = `${host}${canonicalUrl}`;
let channelCanonicalUrl;
@ -29,6 +30,15 @@ class AssetInfo extends React.Component {
}
return (
<div>
{editable && (
<Row>
<RowLabeled
label={<Label value={'Edit:'} />}
content={<Link to={`/edit${canonicalUrl}`}>{name}</Link>}
/>
</Row>
)}
{channelName && (
<Row>
<RowLabeled

View file

@ -2,8 +2,8 @@ import { connect } from 'react-redux';
import View from './view';
import { selectAsset } from '../../selectors/show';
const mapStateToProps = ({ show }) => {
const { claimData: { title } } = selectAsset(show);
const mapStateToProps = (props) => {
const { claimData: { title } } = selectAsset(props.show);
return {
title,
};

View file

@ -1,4 +1,5 @@
kauffj commented 2018-09-25 15:32:51 +02:00 (Migrated from github.com)
Review

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)
kauffj commented 2018-09-25 15:32:51 +02:00 (Migrated from github.com)
Review

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)
import React from 'react';
import { Link } from 'react-router-dom';
kauffj commented 2018-09-25 15:32:51 +02:00 (Migrated from github.com)
Review

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)
import Row from '@components/Row';
const AssetTitle = ({ title }) => {

kauffj commented 2018-09-25 15:32:51 +02:00 (Migrated from github.com)
Review

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)
kauffj commented 2018-09-25 15:32:51 +02:00 (Migrated from github.com)
Review

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)

better to have this out of the h3 ("edit" isn't part of the title for SEO / accessibility purposes, etc.)

View file

@ -36,7 +36,7 @@ class ChannelClaimsDisplay extends React.Component {
<AssetPreview
defaultThumbnail={defaultThumbnail}
claimData={claim}
key={`${claim.name}-${claim.id}`}
key={claim.claimId}
/>
))}
</div>

View file

@ -1,13 +1,29 @@
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
import { connect } from 'react-redux';
import { selectFile, updateError, clearFile } from '../../actions/publish';
import { selectAsset } from '../../selectors/show';
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
import View from './view';
import siteConfig from '@config/siteConfig.json';
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
import createCanonicalLink from '../../../../utils/createCanonicalLink';
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
const mapStateToProps = ({ publish }) => {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
return {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
file : publish.file,
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
thumbnail: publish.thumbnail,
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
fileError: publish.error.file,
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
};
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
const { assetDefaults: { thumbnail: defaultThumbnail } } = siteConfig;
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
const mapStateToProps = ({ show, publish: { file, thumbnail, fileError, isUpdate } }) => {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
const obj = { file, thumbnail, fileError, isUpdate };
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
let asset, name, claimId, fileExt, outpoint, sourceUrl;
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
if (isUpdate) {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
asset = selectAsset(show);
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
const { claimData } = asset;
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
if (asset) {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
obj.fileExt = claimData.contentType.split('/')[1];
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
if (obj.fileExt === 'mp4') {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
obj.sourceUrl = claimData.thumbnail ? claimData.thumbnail : defaultThumbnail;
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
} else {
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
({fileExt, outpoint} = claimData);
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
obj.sourceUrl = `${createCanonicalLink({ asset: claimData })}.${fileExt}?${outpoint}`;
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
}
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
}
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
}
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
return obj;
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
};
const mapDispatchToProps = dispatch => {

skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times
skhameneh commented 2018-11-08 22:46:52 +01:00 (Migrated from github.com)
Review

store asset.claimData in a local var since it's use many times

store `asset.claimData` in a local var since it's use many times

View file

@ -81,53 +81,70 @@ class Dropzone extends React.Component {
}
}
render () {
const { dragOver, mouseOver, dimPreview } = this.state;
const { file, thumbnail, fileError, isUpdate, sourceUrl, fileExt } = this.props;
return (
<div className='dropzone-wrapper'>
<form>
<input
className='input-file'
type='file'
id='file_input'
name='file_input'
accept='video/*,image/*'
onChange={this.handleFileInput}
encType='multipart/form-data'
/>
</form>
<div
className={'dropzone' + (this.state.dragOver ? ' dropzone--drag-over' : '')}
onDrop={this.handleDrop}
onDragOver={this.handleDragOver}
onDragEnd={this.handleDragEnd}
onDragEnter={this.handleDragEnter}
onDragLeave={this.handleDragLeave}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onClick={this.handleClick}>
{this.props.file ? (
<div className={'dropzone-preview-wrapper'}>
<DropzonePreviewImage
dimPreview={this.state.dimPreview}
file={this.props.file}
thumbnail={this.props.thumbnail}
<div>
{isUpdate && fileExt === 'mp4' ? (
<p>Video updates are currently disabled. This feature will be available soon. You can edit metadata.</p>
) : (
<div className='dropzone-wrapper'>
<form>
<input
className='input-file'
type='file'
id='file_input'
name='file_input'
accept='video/*,image/*'
onChange={this.handleFileInput}
encType='multipart/form-data'
/>
<div className={'dropzone-preview-overlay'}>
{ this.state.dragOver ? <DropzoneDropItDisplay /> : null }
{ this.state.mouseOver ? (
</form>
<div
className={'dropzone' + (dragOver ? ' dropzone--drag-over' : '')}
onDrop={this.handleDrop}
onDragOver={this.handleDragOver}
onDragEnd={this.handleDragEnd}
onDragEnter={this.handleDragEnter}
onDragLeave={this.handleDragLeave}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onClick={this.handleClick}>
{file || isUpdate ? (
<div className={'dropzone-preview-wrapper'}>
{file ? (
<DropzonePreviewImage
dimPreview={dimPreview}
file={file}
thumbnail={thumbnail}
/>
) : (
<DropzonePreviewImage
dimPreview
isUpdate
sourceUrl={sourceUrl}
/>
)}
<div className={'dropzone-preview-overlay'}>
{ dragOver ? <DropzoneDropItDisplay /> : null }
{ mouseOver ? (
<DropzoneInstructionsDisplay
fileError={fileError}
message={fileExt === 'mp4' ? 'Drag & drop new thumbnail' : null}
/>
) : null }
</div>
</div>
) : (
dragOver ? <DropzoneDropItDisplay /> : (
<DropzoneInstructionsDisplay
fileError={this.props.fileError}
fileError={fileError}
/>
) : null }
</div>
)
)}
</div>
) : (
this.state.dragOver ? <DropzoneDropItDisplay /> : (
<DropzoneInstructionsDisplay
fileError={this.props.fileError}
/>
)
)}
</div>
</div>
)}
skhameneh commented 2018-11-08 22:49:27 +01:00 (Migrated from github.com)
Review

Can use spread operator for switching props, e.g.:

<Elem ...(showSmall ? { small: true } : { small: false }) />
Can use spread operator for switching props, e.g.: ``` <Elem ...(showSmall ? { small: true } : { small: false }) /> ```
</div>
);
}

View file

@ -1,16 +1,21 @@
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
import { connect } from 'react-redux';
import { clearFile, startPublish } from '../../actions/publish';
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
import { clearFile, startPublish, abandonClaim } from '../../actions/publish';
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
import { selectAsset } from '../../selectors/show';
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
import View from './view';
const mapStateToProps = ({ channel, publish }) => {
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
const mapStateToProps = ({ show, publish }) => {
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
return {
file: publish.file,
isUpdate: publish.isUpdate,
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
hasChanged: publish.hasChanged,
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
asset: selectAsset(show),
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
};
};
const mapDispatchToProps = {
clearFile,
startPublish,
abandonClaim,
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
};
export default connect(mapStateToProps, mapDispatchToProps)(View);

skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method
skhameneh commented 2018-09-24 19:40:21 +02:00 (Migrated from github.com)
Review

You've repeated this code a few times for getting the asset, I'd suggest creating a util method

You've repeated this code a few times for getting the `asset`, I'd suggest creating a util method

View file

@ -1,35 +1,76 @@
import React from 'react';
import { withRouter } from 'react-router-dom';
import {Link, withRouter} from 'react-router-dom';
import PublishUrlInput from '@containers/PublishUrlInput';
import PublishThumbnailInput from '@containers/PublishThumbnailInput';
import PublishMetadataInputs from '@containers/PublishMetadataInputs';
import ChannelSelect from '@containers/ChannelSelect';
import Row from '@components/Row';
import Label from '@components/Label';
import RowLabeled from '@components/RowLabeled';
import ButtonPrimaryJumbo from '@components/ButtonPrimaryJumbo';
import ButtonTertiary from '@components/ButtonTertiary';
import ButtonSecondary from '@components/ButtonSecondary';
import SpaceAround from '@components/SpaceAround';
import PublishFinePrint from '@components/PublishFinePrint';
import { SAVE } from '../../constants/confirmation_messages';
class PublishDetails extends React.Component {
constructor (props) {
super(props);
this.onPublishSubmit = this.onPublishSubmit.bind(this);
this.abandonClaim = this.abandonClaim.bind(this);
this.onCancel = this.onCancel.bind(this);
}
onPublishSubmit () {
this.props.startPublish(this.props.history);
}
abandonClaim () {
const {asset, history} = this.props;
if (asset) {
const {claimData} = asset;
this.props.abandonClaim({claimData, history});
}
}
onCancel () {
const { isUpdate, hasChanged, clearFile, history } = this.props;
if (isUpdate || !hasChanged) {
history.push('/');
} else {
if (confirm(SAVE)) {
clearFile();
}
}
}
render () {
const {file, isUpdate, asset} = this.props;
return (
<div>
<Row>
<PublishUrlInput />
</Row>
{isUpdate ? (asset && (
<Row>
<RowLabeled
label={
<Label value={'Channel:'} />
}
content={
<span className='text'>
{asset.claimData.channelName}
</span>
}
/>
</Row>
)) : (
<React.Fragment>
<Row>
<PublishUrlInput />
</Row>
<Row>
<ChannelSelect />
</Row>
<Row>
<ChannelSelect />
</Row>
</React.Fragment>
)}
{ this.props.file.type === 'video/mp4' && (
{ file && file.type === 'video/mp4' && (
<Row>
<PublishThumbnailInput />
</Row>
@ -41,16 +82,27 @@ class PublishDetails extends React.Component {
<Row>
<ButtonPrimaryJumbo
value={'Publish'}
value={isUpdate ? 'Update' : 'Publish'}
onClickHandler={this.onPublishSubmit}
/>
</Row>
{isUpdate && (
<Row>
<SpaceAround>
<ButtonSecondary
value={'Abandon Claim'}
onClickHandler={this.abandonClaim}
/>
</SpaceAround>
</Row>
)}
<Row>
<SpaceAround>
<ButtonTertiary
value={'Cancel'}
onClickHandler={this.props.clearFile}
onClickHandler={this.onCancel}
/>
</SpaceAround>
</Row>

View file

@ -8,6 +8,7 @@ const mapStateToProps = ({ publish }) => {
description : publish.metadata.description,
license : publish.metadata.license,
nsfw : publish.metadata.nsfw,
isUpdate : publish.isUpdate,
};
};

View file

@ -26,27 +26,30 @@ class PublishMetadataInputs extends React.Component {
this.props.onMetadataChange(name, selectedOption);
}
render () {
const { showMetadataInputs, description, isUpdate, nsfw } = this.props;
return (
<div>
{this.props.showMetadataInputs && (
{(showMetadataInputs || isUpdate) && (
<div>
<PublishDescriptionInput
description={this.props.description}
description={description}
handleInput={this.handleInput}
/>
<PublishLicenseInput
handleSelect={this.handleSelect}
/>
<PublishNsfwInput
nsfw={this.props.nsfw}
nsfw={nsfw}
handleInput={this.handleInput}
/>
</div>
)}
<ButtonSecondary
value={this.props.showMetadataInputs ? 'less' : 'more'}
onClickHandler={this.toggleShowInputs}
/>
{!isUpdate && (
<ButtonSecondary
value={showMetadataInputs ? 'less' : 'more'}
onClickHandler={this.toggleShowInputs}
/>
)}
</div>
);
}

View file

@ -12,7 +12,7 @@ class PublishStatus extends React.Component {
{status === publishStates.LOAD_START &&
<div className={'status'}>
<Row>
<p>le is loading to server</p>
<p>File is loading to server</p>
</Row>
<Row>
<p className={'text--secondary'}>0%</p>
@ -42,7 +42,7 @@ class PublishStatus extends React.Component {
</Row>
</div>
}
{status === publishStates.SUCCESS &&
{status === publishStates.SUCCEEDED &&
<div className={'status'}>
<Row>
<p>Your publish is complete! You are being redirected to it now.</p>
@ -71,6 +71,13 @@ class PublishStatus extends React.Component {
</Row>
</div>
}
{status === publishStates.ABANDONING &&
<div className={'status'}>
<Row>
<p>Your claim is being abandoned.</p>
</Row>
</div>
}
</div>
);
}

View file

@ -1,11 +1,22 @@
import {connect} from 'react-redux';
import View from './view';
import {selectAsset} from "../../selectors/show";
import {buildURI} from "../../utils/buildURI";
const mapStateToProps = ({ publish }) => {
const mapStateToProps = props => {
const { show, publish } = props;
const asset = selectAsset(show);
let uri;
if (asset) {
uri = `lbry://${buildURI(asset)}`;
}
return {
disabled: publish.disabled,
file : publish.file,
status : publish.status.status,
file: publish.file,
status: publish.status.status,
isUpdate: publish.isUpdate,
hasChanged: publish.hasChanged,
uri,
};
};

View file

@ -1,23 +1,34 @@
import React from 'react';
import { withRouter, Prompt } from 'react-router';
import Dropzone from '@containers/Dropzone';
import PublishPreview from '@components/PublishPreview';
import PublishStatus from '@containers/PublishStatus';
import PublishDisabledMessage from '@containers/PublishDisabledMessage';
import { SAVE } from '../../constants/confirmation_messages';
class PublishTool extends React.Component {
render () {
if (this.props.disabled) {
const {disabled, file, isUpdate, hasChanged, uri, status, location: currentLocation} = this.props;
if (disabled) {
return (
<PublishDisabledMessage />
);
} else {
if (this.props.file) {
if (this.props.status) {
if (file || isUpdate) {
if (status) {
return (
<PublishStatus />
);
} else {
return <PublishPreview />;
return (
<React.Fragment>
<Prompt
when={hasChanged}
message={(location) => location.pathname === currentLocation.pathname ? false : SAVE}
/>
<PublishPreview isUpdate={isUpdate} uri={uri} />
</React.Fragment>
);
}
}
return <Dropzone />;
@ -25,4 +36,4 @@ class PublishTool extends React.Component {
}
};
export default PublishTool;
export default withRouter(PublishTool);

View file

@ -1,4 +1,5 @@
import React from 'react';
import { withRouter } from 'react-router';
import PageLayout from '@components/PageLayout';
import HorizontalSplit from '@components/HorizontalSplit';
import AboutSpeechOverview from '@components/AboutSpeechOverview';
@ -20,4 +21,4 @@ class AboutPage extends React.Component {
}
}
export default AboutPage;
export default withRouter(AboutPage);

View file

@ -0,0 +1,24 @@
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
import { connect } from 'react-redux';
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
import { setUpdateTrue, setHasChanged, updateMetadata, clearFile } from '../../actions/publish';
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
import { onHandleShowPageUri } from '../../actions/show';
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
import { selectAsset } from '../../selectors/show';
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
import View from './view';
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
const mapStateToProps = (props) => {
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
const { show } = props;
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
return {
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
asset : selectAsset(show),
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
myChannel: props.channel.loggedInChannel.name,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
isUpdate : props.publish.isUpdate,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
};
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
};
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
const mapDispatchToProps = {
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
updateMetadata,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
onHandleShowPageUri,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
setUpdateTrue,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
setHasChanged,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
clearFile,
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
};
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util
export default connect(mapStateToProps, mapDispatchToProps)(View);
skhameneh commented 2018-09-24 19:41:04 +02:00 (Migrated from github.com)
Review

See above comment about adding a util

See above comment about adding a util

View file

@ -0,0 +1,43 @@
import React from 'react';
import PageLayout from '@components/PageLayout';
import { Redirect } from 'react-router-dom';
import PublishTool from '@containers/PublishTool';
class EditPage extends React.Component {
componentDidMount () {
const {asset, match, onHandleShowPageUri, setUpdateTrue, setHasChanged, updateMetadata} = this.props;
onHandleShowPageUri(match.params);
setUpdateTrue();
if (asset) {
['title', 'description', 'license', 'nsfw'].forEach(meta => updateMetadata(meta, asset.claimData[meta]));
}
setHasChanged(false);
}
componentWillUnmount () {
this.props.clearFile();
}
render () {
const { myChannel, asset } = this.props;
// redirect if user does not own this claim
if (
!myChannel || (
asset &&
asset.claimsData &&
asset.claimsData.channelName &&
asset.claimsData.channelName !== myChannel
)
) {
return (<Redirect to={'/'} />);
kauffj commented 2018-09-25 15:36:18 +02:00 (Migrated from github.com)
Review

Do we need to redirect to login? Show an error? How would this happen to a user genuinely?

(one guess: sign in in one tab, then sign in a second tab, and click edit from the first tab)

Do we need to redirect to login? Show an error? How would this happen to a user genuinely? (one guess: sign in in one tab, then sign in a second tab, and click edit from the first tab)
daovist commented 2018-09-25 19:44:15 +02:00 (Migrated from github.com)
Review

I was only considering a nefarious user. I don't think this matters much; just needs to not render the edit page.

I was only considering a nefarious user. I don't think this matters much; just needs to not render the edit page.
}
return (
<PageLayout
pageTitle={'Edit claim'}
pageUri={'edit'}
>
<PublishTool />
</PageLayout>
);
}
};
export default EditPage;

View file

@ -1,17 +1,20 @@
import { connect } from 'react-redux';
import { onHandleShowHomepage } from '../../actions/show';
import { clearFile } from '../../actions/publish';
import View from './view';
const mapStateToProps = ({ show, site, channel }) => {
const mapStateToProps = ({ show, site, channel, publish }) => {
return {
error : show.request.error,
requestType: show.request.type,
homeChannel: site.publishOnlyApproved && !channel.loggedInChannel.name ? `${site.approvedChannels[0].name}:${site.approvedChannels[0].longId}` : null,
isUpdate : publish.isUpdate,
};
};
const mapDispatchToProps = {
onHandleShowHomepage,
clearFile,
};
export default connect(mapStateToProps, mapDispatchToProps)(View);

View file

@ -4,16 +4,9 @@ import PublishTool from '@containers/PublishTool';
import ContentPageWrapper from '@pages/ContentPageWrapper';
class HomePage extends React.Component {
componentDidMount () {
this.props.onHandleShowHomepage(this.props.match.params);
componentWillUnmount () {
this.props.clearFile();
}
componentWillReceiveProps (nextProps) {
if (nextProps.match.params !== this.props.match.params) {
this.props.onHandleShowHomepage(nextProps.match.params);
}
}
render () {
kauffj commented 2018-09-25 15:37:51 +02:00 (Migrated from github.com)
Review

Why does this have to happen here? Does this have to happen for any component that includes <PublishTool />? If so, this should be avoided.

Why does this have to happen here? Does this have to happen for any component that includes `<PublishTool />`? If so, this should be avoided.
daovist commented 2018-09-26 18:08:00 +02:00 (Migrated from github.com)
Review

Nice catch/good point! Current speech only clears the file for file errors, reset, publish success, and cancel publish, so two features using the same state.publish were stepping on each others toes

My new approach uses isUpdate

When the publish page mounts: if isUpdate then clearFile

When edit page mounts: if !isUpdate then clearFile, setUpdateTrue, setMetadata

This way a user can start a publish or update, leave the page, and come back to where they were, like current speech, unless they go to the other (Edit/Publish) page, in which case it starts fresh with publish or update

code

Nice catch/good point! Current speech only clears the file for file errors, reset, publish success, and cancel publish, so two features using the same `state.publish` were stepping on each others toes My new approach uses `isUpdate` When the publish page mounts: if `isUpdate` then `clearFile` When edit page mounts: if `!isUpdate` then `clearFile, setUpdateTrue, setMetadata` This way a user can start a publish or update, leave the page, and come back to where they were, like current speech, unless they go to the other (Edit/Publish) page, in which case it starts fresh with publish or update [code](https://github.com/lbryio/spee.ch/pull/595/commits/7c4323ba648fea1e8e2b361a17654b10ae66ff93)
kauffj commented 2018-09-26 20:19:01 +02:00 (Migrated from github.com)
Review

👍

:+1:
const { homeChannel } = this.props;
return homeChannel ? (

View file

@ -1,20 +1,10 @@
import { connect } from 'react-redux';
import { selectAsset } from '../../selectors/show';
import View from './view';
const mapStateToProps = ({ show }) => {
// select request info
const requestId = show.request.id;
// select asset info
let asset;
const request = show.requestList[requestId] || null;
const assetList = show.assetList;
if (request && assetList) {
const assetKey = request.key; // note: just store this in the request
asset = assetList[assetKey] || null;
};
// return props
return {
asset,
asset: selectAsset(show),
};
};

View file

@ -1,6 +1,5 @@
import React from 'react';
import PageLayout from '@components/PageLayout';
import HorizontalSplit from '@components/HorizontalSplit';
import AssetTitle from '@containers/AssetTitle';
import AssetDisplay from '@containers/AssetDisplay';

View file

@ -41,6 +41,8 @@ const initialState = {
license : '',
nsfw : false,
},
isUpdate: false,
hasChanged: false,
thumbnail: null,
thumbnailChannel,
thumbnailChannelId,
@ -49,8 +51,9 @@ const initialState = {
export default function (state = initialState, action) {
switch (action.type) {
case actions.FILE_SELECTED:
return Object.assign({}, initialState, { // note: clears to initial state
return Object.assign({}, state.isUpdate ? state : initialState, { // note: clears to initial state
file: action.data,
hasChanged: true,
});
case actions.FILE_CLEAR:
return initialState;
@ -59,14 +62,17 @@ export default function (state = initialState, action) {
metadata: Object.assign({}, state.metadata, {
[action.data.name]: action.data.value,
}),
hasChanged: true,
});
case actions.CLAIM_UPDATE:
return Object.assign({}, state, {
claim: action.data,
hasChanged: true,
});
case actions.SET_PUBLISH_IN_CHANNEL:
return Object.assign({}, state, {
publishInChannel: action.channel,
hasChanged: true,
});
case actions.PUBLISH_STATUS_UPDATE:
return Object.assign({}, state, {
@ -83,13 +89,26 @@ export default function (state = initialState, action) {
selectedChannel: action.data,
});
case actions.TOGGLE_METADATA_INPUTS:
return Object.assign({}, state, {
return {
...state,
showMetadataInputs: action.data,
});
};
case actions.THUMBNAIL_NEW:
return Object.assign({}, state, {
return {
...state,
thumbnail: action.data,
});
hasChanged: true,
};
case actions.SET_UPDATE_TRUE:
return {
...state,
isUpdate: true,
};
case actions.SET_HAS_CHANGED:
return {
...state,
hasChanged: action.data,
};
default:
return state;
}

View file

@ -65,6 +65,43 @@ export default function (state = initialState, action) {
},
}),
});
case actions.ASSET_REMOVE:
const claim = action.data;
const newAssetList = state.assetList;
delete newAssetList[`a#${claim.name}#${claim.claimId}`];
const channelId = `c#${claim.channelName}#${claim.certificateId}`;
const channelClaims = state.channelList[channelId].claimsData.claims;
const newClaimsData = channelClaims.filter(c => c.claimId !== claim.claimId);
return {
...state,
assetList : newAssetList,
channelList: {
...state.channelList,
[channelId]: {
...state.channelList[channelId],
claimsData: {
...state.channelList[channelId].claimsData,
claims: newClaimsData,
},
},
},
};
case actions.ASSET_UPDATE_CLAIMDATA:
return {
...state,
assetList: {
...state.assetList,
[action.data.id]: {
...state.assetList[action.data.id],
claimData: {
...state.assetList[action.data.id].claimData,
...action.data.claimData,
},
},
},
};
// channel data
case actions.CHANNEL_ADD:
return Object.assign({}, state, {
@ -77,7 +114,7 @@ export default function (state = initialState, action) {
},
}),
});
case actions.CHANNEL_CLAIMS_UPDATE_SUCCESS:
case actions.CHANNEL_CLAIMS_UPDATE_SUCCEEDED:
return Object.assign({}, state, {
channelList: Object.assign({}, state.channelList, {
[action.data.channelListId]: Object.assign({}, state.channelList[action.data.channelListId], {

View file

@ -0,0 +1,30 @@
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
import { call, put, takeLatest } from 'redux-saga/effects';
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
import * as actions from '../constants/publish_action_types';
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
import * as publishStates from '../constants/publish_claim_states';
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
import { updatePublishStatus, clearFile } from '../actions/publish';
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
import { removeAsset } from '../actions/show';
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
import { doAbandonClaim } from '../api/assetApi';
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
function * abandonClaim (action) {
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
const { claimData, history } = action.data;
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
const { claimId } = claimData;
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
const confirm = window.confirm('Are you sure you want to abandon this claim? This action cannot be undone.');
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:46:17 +02:00 (Migrated from github.com)
Review

This works for now, but we should have some common prompt to match Spee.ch.

This works for now, but we should have some common prompt to match Spee.ch.
if (!confirm) return;
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
yield put(updatePublishStatus(publishStates.ABANDONING, 'Your claim is being abandoned...'));
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
try {
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
yield call(doAbandonClaim, claimId);
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
} catch (error) {
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
return console.log('abandon error:', error.message);
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
}
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
yield put(clearFile());
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
yield put(removeAsset(claimData));
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
return history.push('/');
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
}
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
export function * watchAbandonClaim () {
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
yield takeLatest(actions.ABANDON_CLAIM, abandonClaim);
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)
};
skhameneh commented 2018-09-24 19:44:39 +02:00 (Migrated from github.com)
Review

Should use consistent formatting (I know, the existing code is inconsistent)

Should use consistent formatting (I know, the existing code is inconsistent)

View file

@ -5,37 +5,57 @@ import { updateError, updatePublishStatus, clearFile } from '../actions/publish'
import { selectPublishState } from '../selectors/publish';
import { selectChannelState } from '../selectors/channel';
import { selectSiteState } from '../selectors/site';
import { selectShowState, selectAsset } from '../selectors/show';
import { validateChannelSelection, validateNoPublishErrors } from '../utils/validate';
import { createPublishMetadata, createPublishFormData, createThumbnailUrl } from '../utils/publish';
import { makePublishRequestChannel } from '../channels/publish';
function * publishFile (action) {
const { history } = action.data;
const { publishInChannel, selectedChannel, file, claim, metadata, thumbnailChannel, thumbnailChannelId, thumbnail, error: publishToolErrors } = yield select(selectPublishState);
const publishState = yield select(selectPublishState);
const { publishInChannel, selectedChannel, file, claim, metadata, thumbnailChannel, thumbnailChannelId, thumbnail, isUpdate, error: publishToolErrors } = publishState;
const { loggedInChannel } = yield select(selectChannelState);
const { host } = yield select(selectSiteState);
let show, asset;
if (isUpdate) {
show = yield select(selectShowState);
asset = selectAsset(show);
}
// validate the channel selection
try {
validateChannelSelection(publishInChannel, selectedChannel, loggedInChannel);
} catch (error) {
return yield put(updateError('channel', error.message));
};
}
// validate publish parameters
try {
validateNoPublishErrors(publishToolErrors);
} catch (error) {
return console.log('publish error:', error.message);
}
let publishMetadata, publishFormData, publishChannel;
// create metadata
let publishMetadata = createPublishMetadata(claim, file, metadata, publishInChannel, selectedChannel);
publishMetadata = createPublishMetadata(
isUpdate ? asset.name : claim,
isUpdate ? {type: asset.claimData.contentType} : file,
metadata,
publishInChannel,
selectedChannel
);
if (isUpdate) {
publishMetadata['channelName'] = asset.claimData.channelName;
}
if (thumbnail) {
// add thumbnail to publish metadata
publishMetadata['thumbnail'] = createThumbnailUrl(thumbnailChannel, thumbnailChannelId, claim, host);
publishMetadata['thumbnail'] = createThumbnailUrl(thumbnailChannel, thumbnailChannelId, claim, host);
}
// create form data for main publish
const publishFormData = createPublishFormData(file, thumbnail, publishMetadata);
publishFormData = createPublishFormData(file, thumbnail, publishMetadata);
// make the publish request
const publishChannel = yield call(makePublishRequestChannel, publishFormData);
publishChannel = yield call(makePublishRequestChannel, publishFormData, isUpdate);
while (true) {
const {loadStart, progress, load, success, error: publishError} = yield take(publishChannel);
if (publishError) {
@ -43,7 +63,21 @@ function * publishFile (action) {
}
if (success) {
yield put(clearFile());
return history.push(`/${success.data.claimId}/${success.data.name}`);
if (isUpdate) {
yield put({
type: 'ASSET_UPDATE_CLAIMDATA',
data: {
id : `a#${success.data.name}#${success.data.claimId}`,
claimData: success.data.claimData,
},
});
}
if (success.data.claimId) {
return history.push(success.data.pushTo);
} else {
// this returns to the homepage, needs work
return yield put(updatePublishStatus(publishStates.FAILED, 'ERROR'));
}
}
if (loadStart) {
yield put(updatePublishStatus(publishStates.LOAD_START, null));
@ -55,7 +89,7 @@ function * publishFile (action) {
yield put(updatePublishStatus(publishStates.PUBLISHING, null));
}
}
};
}
export function * watchPublishStart () {
yield takeLatest(actions.PUBLISH_START, publishFile);

View file

@ -10,6 +10,7 @@ import { watchUpdateChannelAvailability } from './updateChannelAvailability';
import { watchChannelCreate } from './createChannel';
import { watchChannelLoginCheck } from './checkForLoggedInChannel';
import { watchChannelLogout } from './logoutChannel';
import { watchAbandonClaim } from './abandon';
export function * rootSaga () {
yield all([
@ -27,5 +28,6 @@ export function * rootSaga () {
watchChannelLoginCheck(),
watchChannelLogout(),
watchUpdateAssetViews(),
watchAbandonClaim(),
]);
}

View file

@ -1,7 +1,13 @@
export const selectAsset = (show) => {
const request = show.requestList[show.request.id];
const assetKey = request.key;
return show.assetList[assetKey];
export const selectAsset = show => {
const requestId = show.request.id;
let asset;
const request = show.requestList[requestId] || null;
const assetList = show.assetList;
if (request && assetList) {
const assetKey = request.key; // note: just store this in the request
asset = assetList[assetKey] || null;
}
return asset;
};
export const selectShowState = (state) => {

View file

@ -0,0 +1,10 @@
export const buildURI = asset => {
let channelName, certificateId, name, claimId;
if (asset.claimData) {
({ channelName, certificateId, name, claimId } = asset.claimData);
}
if (channelName) {
return `${channelName}:${certificateId}/${name}`;
}
return `${claimId}/${name}`;
};

View file

@ -16,7 +16,9 @@ export const createPublishMetadata = (claim, { type }, { title, description, lic
export const createPublishFormData = (file, thumbnail, metadata) => {
let fd = new FormData();
// append file
fd.append('file', file);
if (file) {
fd.append('file', file);
}
// append thumbnail
if (thumbnail) {
fd.append('thumbnail', thumbnail);
@ -31,5 +33,5 @@ export const createPublishFormData = (file, thumbnail, metadata) => {
};
export const createThumbnailUrl = (channel, channelId, claim, host) => {
return `${host}/${channel}:${channelId}/${claim}-thumb.png`;
return `${host}/${channel}:${channelId}/${claim}-thumb.jpg`;
};

View file

@ -850,7 +850,7 @@ var claimQueries = (db, table, sequelize) => ({
});
},
getShortClaimIdFromLongClaimId: async (claimId, claimName) => {
getShortClaimIdFromLongClaimId: async (claimId, claimName, pendingClaim) => {
logger$1.debug(`claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`);
return await table.findAll({
where: { name: claimName },
@ -860,7 +860,12 @@ var claimQueries = (db, table, sequelize) => ({
throw new Error('No claim(s) found with that claim name');
}
return returnShortId(result, claimId);
let list = result.map(claim => claim.dataValues);
if (pendingClaim) {
list = list.concat(pendingClaim);
}
return returnShortId(list, claimId);
});
},
@ -981,6 +986,24 @@ var claimQueries = (db, table, sequelize) => ({
});
},
resolveClaimInChannel: async (claimName, channelId) => {
logger$1.debug(`Claim.resolveClaimByNames: ${claimName} in ${channelId}`);
return table.findAll({
where: {
name: claimName,
publisher_id: channelId,
},
}).then(claimArray => {
if (claimArray.length === 0) {
return null;
} else if (claimArray.length !== 1) {
logger$1.warn(`more than one record matches ${claimName} in ${channelId}`);
}
return claimArray[0];
});
},
getOutpoint: async (name, claimId) => {
logger$1.debug(`finding outpoint for ${name}#${claimId}`);

View file

@ -49,7 +49,7 @@ export default (db, table, sequelize) => ({
});
},
getShortClaimIdFromLongClaimId: async (claimId, claimName) => {
getShortClaimIdFromLongClaimId: async (claimId, claimName, pendingClaim) => {
logger.debug(`claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`);
return await table.findAll({
where: { name: claimName },
@ -59,7 +59,12 @@ export default (db, table, sequelize) => ({
throw new Error('No claim(s) found with that claim name');
}
return returnShortId(result, claimId);
let list = result.map(claim => claim.dataValues);
if (pendingClaim) {
list = list.concat(pendingClaim);
}
return returnShortId(list, claimId);
});
},
@ -180,6 +185,24 @@ export default (db, table, sequelize) => ({
});
},
resolveClaimInChannel: async (claimName, channelId) => {
logger.debug(`Claim.resolveClaimByNames: ${claimName} in ${channelId}`);
return table.findAll({
where: {
name: claimName,
publisher_id: channelId,
},
}).then(claimArray => {
if (claimArray.length === 0) {
return null;
} else if (claimArray.length !== 1) {
logger.warn(`more than one record matches ${claimName} in ${channelId}`);
}
return claimArray[0];
});
},
getOutpoint: async (name, claimId) => {
logger.debug(`finding outpoint for ${name}#${claimId}`);

View file

@ -5,7 +5,11 @@ const { returnPaginatedChannelClaims } = require('./channelPagination.js');
const getChannelClaims = async (channelName, channelShortId, page) => {
const channelId = await chainquery.claim.queries.getLongClaimId(channelName, channelShortId);
const channelClaims = await chainquery.claim.queries.getAllChannelClaims(channelId);
let channelClaims;
if (channelId) {
channelClaims = await chainquery.claim.queries.getAllChannelClaims(channelId);
}
const processingChannelClaims = channelClaims ? channelClaims.map((claim) => getClaimData(claim)) : [];
const processedChannelClaims = await Promise.all(processingChannelClaims);

View file

@ -0,0 +1,44 @@
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const logger = require('winston');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const db = require('server/models');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const { abandonClaim } = require('server/lbrynet');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const deleteFile = require('../publish/deleteFile.js');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const authenticateUser = require('../publish/authentication.js');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
/*
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
route to abandon a claim through the daemon
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
*/
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const claimAbandon = async (req, res) => {
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
kauffj commented 2018-09-25 15:42:51 +02:00 (Migrated from github.com)
Review

This function looks great! Looking forward to more like this

This function looks great! Looking forward to more like this
const {claimId} = req.body;
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const {user} = req;
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
try {
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const [channel, claim] = await Promise.all([
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
authenticateUser(user.channelName, null, null, user),
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
db.Claim.findOne({where: {claimId}}),
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
]);
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
if (!claim) throw new Error('That channel does not exist');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
if (!channel.channelName) throw new Error('You don\'t own this channel');
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
await abandonClaim({claimId});
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
const file = await db.File.findOne({where: {claimId}});
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
await Promise.all([
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
deleteFile(file.filePath),
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
db.File.destroy({where: {claimId}}),
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
db.Claim.destroy({where: {claimId}}),
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
]);
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
logger.debug(`Claim abandoned: ${claimId}`);
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
res.status(200).json({
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
success: true,
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
message: `Claim with id ${claimId} abandonded`,
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
});
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
} catch (error) {
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
logger.error('abandon claim error:', error);
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
res.status(400).json({
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
success: false,
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
message: error.message,
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
});
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
}
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
};
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases
module.exports = claimAbandon;
skhameneh commented 2018-11-08 22:53:32 +01:00 (Migrated from github.com)
Review

use the aliases

use the aliases
skhameneh commented 2018-11-08 22:53:41 +01:00 (Migrated from github.com)
Review

use aliases

use aliases

View file

@ -1,8 +1,8 @@
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
const getClaimData = require('server/utils/getClaimData');
const fetchClaimData = require('server/utils/fetchClaimData');
const chainquery = require('chainquery');
const db = require('server/models');
/*
route to return data for a claim
@ -10,16 +10,9 @@ const db = require('server/models');
*/
const claimData = async ({ ip, originalUrl, body, params }, res) => {
const claimName = params.claimName;
let claimId = params.claimId;
if (claimId === 'none') claimId = null;
try {
let resolvedClaim = await chainquery.claim.queries.resolveClaim(claimName, claimId).catch(() => {});
if(!resolvedClaim) {
resolvedClaim = await db.Claim.resolveClaim(claimName, claimId);
}
const resolvedClaim = await fetchClaimData(params);
if (!resolvedClaim) {
return res.status(404).json({

View file

@ -11,7 +11,7 @@ const createPublishParams = (filePath, name, title, description, license, nsfw,
}
// provide default for license
if (license === null || license.trim() === '') {
license = ' '; // default to empty string
license = ''; // default to empty string
}
// create the basic publish params
const publishParams = {

View file

@ -17,6 +17,9 @@ const parsePublishApiRequestBody = require('./parsePublishApiRequestBody.js');
const parsePublishApiRequestFiles = require('./parsePublishApiRequestFiles.js');
const authenticateUser = require('./authentication.js');
const chainquery = require('chainquery');
const createCanonicalLink = require('../../../../../utils/createCanonicalLink');
skhameneh commented 2018-11-08 22:53:56 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const CLAIM_TAKEN = 'CLAIM_TAKEN';
const UNAPPROVED_CHANNEL = 'UNAPPROVED_CHANNEL';
@ -42,7 +45,25 @@ const claimPublish = ({ body, files, headers, ip, originalUrl, user, tor }, res)
});
}
// define variables
let channelName, channelId, channelPassword, description, fileName, filePath, fileExtension, fileType, gaStartTime, license, name, nsfw, thumbnail, thumbnailFileName, thumbnailFilePath, thumbnailFileType, title;
let channelName,
channelId,
channelPassword,
description,
fileName,
filePath,
fileExtension,
fileType,
gaStartTime,
license,
name,
nsfw,
thumbnail,
thumbnailFileName,
thumbnailFilePath,
thumbnailFileType,
title,
claimData,
claimId;
// record the start time of the request
gaStartTime = Date.now();
// validate the body and files of the request
@ -64,6 +85,7 @@ const claimPublish = ({ body, files, headers, ip, originalUrl, user, tor }, res)
};
throw error;
}
return Promise.all([
checkClaimAvailability(name),
createPublishParams(filePath, name, title, description, license, nsfw, thumbnail, channelName, channelClaimId),
@ -83,19 +105,40 @@ const claimPublish = ({ body, files, headers, ip, originalUrl, user, tor }, res)
publish(thumbnailPublishParams, thumbnailFileName, thumbnailFileType);
}
// publish the asset
return publish(publishParams, fileName, fileType);
return publish(publishParams, fileName, fileType, filePath);
})
.then(result => {
.then(publishResults => {
logger.info('Publish success >', publishResults);
claimData = publishResults;
({claimId} = claimData);
if (channelName) {
return chainquery.claim.queries.getShortClaimIdFromLongClaimId(claimData.certificateId, channelName);
} else {
return chainquery.claim.queries.getShortClaimIdFromLongClaimId(claimId, name, claimData).catch(error => {
return claimId.slice(0, 1);
});
}
})
.then(shortId => {
let canonicalUrl;
if (channelName) {
canonicalUrl = createCanonicalLink({ asset: { ...claimData, channelShortId: shortId } });
} else {
canonicalUrl = createCanonicalLink({ asset: { ...claimData, shortId } })
}
res.status(200).json({
success: true,
message: 'publish completed successfully',
data : {
name,
claimId : result.claim_id,
url : `${host}/${result.claim_id}/${name}`, // for backwards compatability with app
showUrl : `${host}/${result.claim_id}/${name}`,
serveUrl: `${host}/${result.claim_id}/${name}${fileExtension}`,
lbryTx : result,
claimId,
url : `${host}${canonicalUrl}`, // for backwards compatability with app
showUrl : `${host}${canonicalUrl}`,
serveUrl: `${host}${canonicalUrl}${fileExtension}`,
pushTo : canonicalUrl,
claimData,
},
});
// record the publish end time and send to google analytics

View file

@ -1,9 +1,19 @@
const path = require('path');
const validateFileTypeAndSize = require('./validateFileTypeAndSize.js');
const parsePublishApiRequestFiles = ({file, thumbnail}) => {
const parsePublishApiRequestFiles = ({file, thumbnail}, isUpdate) => {
// make sure a file was provided
if (!file) {
if (isUpdate) {
if (thumbnail) {
const obj = {};
obj.thumbnailFileName = thumbnail.name;
obj.thumbnailFilePath = thumbnail.path;
obj.thumbnailFileType = thumbnail.type;
return obj;
}
return {};
}
throw new Error('no file with key of [file] found in request');
}
if (!file.path) {
@ -28,18 +38,24 @@ const parsePublishApiRequestFiles = ({file, thumbnail}) => {
if (/'/.test(file.name)) {
throw new Error('apostrophes are not allowed in the file name');
}
// validate the file
validateFileTypeAndSize(file);
if (file) validateFileTypeAndSize(file);
// return results
return {
fileName : file.name,
filePath : file.path,
fileExtension : path.extname(file.path),
fileType : file.type,
thumbnailFileName: (thumbnail ? thumbnail.name : null),
thumbnailFilePath: (thumbnail ? thumbnail.path : null),
thumbnailFileType: (thumbnail ? thumbnail.type : null),
const obj = {
fileName : file.name,
filePath : file.path,
fileExtension: path.extname(file.path),
fileType : file.type,
};
if (thumbnail) {
obj.thumbnailFileName = thumbnail.name;
obj.thumbnailFilePath = thumbnail.path;
obj.thumbnailFileType = thumbnail.type;
}
return obj;
};
module.exports = parsePublishApiRequestFiles;

View file

@ -1,81 +1,72 @@
const logger = require('winston');
const { publishClaim } = require('../../../../lbrynet');
const db = require('../../../../models');
const { publishClaim } = require('../../../../lbrynet');
const { createFileRecordDataAfterPublish } = require('../../../../models/utils/createFileRecordData.js');
const { createClaimRecordDataAfterPublish } = require('../../../../models/utils/createClaimRecordData.js');
const deleteFile = require('./deleteFile.js');
const publish = (publishParams, fileName, fileType) => {
return new Promise((resolve, reject) => {
let publishResults, certificateId, channelName;
// publish the file
return publishClaim(publishParams)
.then(result => {
logger.info(`Successfully published ${publishParams.name} ${fileName}`, result);
const publish = async (publishParams, fileName, fileType) => {
let publishResults;
let channel;
let fileRecord;
let newFile = Boolean(publishParams.file_path);
// Support new daemon, TODO: remove
publishResults = result.output && result.output.claim_id ? result.output : result;
// get the channel information
if (publishParams.channel_name) {
logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);
return db.Channel.findOne({
where: {
channelName: publishParams.channel_name,
},
});
} else {
logger.debug('this claim was not published in a channel');
return null;
}
})
.then(channel => {
// set channel information
certificateId = null;
channelName = null;
if (channel) {
certificateId = channel.channelClaimId;
channelName = channel.channelName;
}
logger.debug(`certificateId: ${certificateId}`);
})
.then(() => {
return Promise.all([
createFileRecordDataAfterPublish(fileName, fileType, publishParams, publishResults),
createClaimRecordDataAfterPublish(certificateId, channelName, fileName, fileType, publishParams, publishResults),
]);
})
.then(([fileRecord, claimRecord]) => {
// upsert the records
const {name} = publishParams;
const {claim_id: claimId} = publishResults;
const upsertCriteria = {
name,
claimId,
};
return Promise.all([
db.upsert(db.File, fileRecord, upsertCriteria, 'File'),
db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim'),
]);
})
.then(([file, claim]) => {
logger.debug('File and Claim records successfully created');
return Promise.all([
file.setClaim(claim),
claim.setFile(file),
]);
})
.then(() => {
logger.debug('File and Claim records successfully associated');
// resolve the promise with the result from lbryApi publishClaim;
resolve(publishResults);
})
.catch(error => {
logger.error('PUBLISH ERROR', error);
deleteFile(publishParams.file_path); // delete the local file
reject(error);
try {
publishResults = await publishClaim(publishParams);
logger.info(`Successfully published ${publishParams.name} ${fileName}`, publishResults);
const outpoint = `${publishResults.output.txid}:${publishResults.output.nout}`;
// get the channel information
if (publishParams.channel_name) {
logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);
channel = await db.Channel.findOne({
where: {
channelName: publishParams.channel_name,
},
});
});
} else {
channel = null;
}
const certificateId = channel ? channel.channelClaimId : null;
const channelName = channel ? channel.channelName : null;
const claimRecord = await createClaimRecordDataAfterPublish(certificateId, channelName, fileName, fileType, publishParams, publishResults);
const {claimId} = claimRecord;
const upsertCriteria = {name: publishParams.name, claimId};
if (newFile) {
// this is the problem
//
fileRecord = await createFileRecordDataAfterPublish(fileName, fileType, publishParams, publishResults);
} else {
fileRecord = await db.File.findOne({where: {claimId}}).then(result => result.dataValues);
}
const [file, claim] = await Promise.all([
db.upsert(db.File, fileRecord, upsertCriteria, 'File'),
db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim'),
]);
logger.info(`File and Claim records successfully created (${publishParams.name})`);
await Promise.all([
file.setClaim(claim),
claim.setFile(file),
]);
logger.info(`File and Claim records successfully associated (${publishParams.name})`);
return Object.assign({}, claimRecord, {outpoint});
} catch (err) {
// parse daemon response when err is a string
// this needs work
logger.info('publish/publish err:', err);
const error = typeof err === 'string' ? JSON.parse(err) : err;
if (publishParams.file_path) {
await deleteFile(publishParams.file_path);
}
const message = error.error && error.error.message ? error.error.message : 'Unknown publish error';
return {
error: true,
message,
};
}
};
module.exports = publish;

View file

@ -0,0 +1,199 @@
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const logger = require('winston');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const db = require('server/models');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const { details, publishing: { disabled, disabledMessage, primaryClaimAddress } } = require('@config/siteConfig');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const { resolveUri } = require('server/lbrynet');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const { sendGATimingEvent } = require('../../../../utils/googleAnalytics.js');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const publish = require('../publish/publish.js');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const parsePublishApiRequestBody = require('../publish/parsePublishApiRequestBody');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const parsePublishApiRequestFiles = require('../publish/parsePublishApiRequestFiles.js');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const authenticateUser = require('../publish/authentication.js');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const createThumbnailPublishParams = require('../publish/createThumbnailPublishParams.js');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const chainquery = require('chainquery');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const createCanonicalLink = require('../../../../../utils/createCanonicalLink');
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
/*
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
route to update a claim through the daemon
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
*/
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const updateMetadata = ({nsfw, license, title, description}) => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const update = {};
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (nsfw) update['nsfw'] = nsfw;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (license) update['license'] = license;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (title) update['title'] = title;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (description) update['description'] = description;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return update;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
};
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const rando = () => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
let text = '';
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
for (let i = 0; i < 6; i += 1) text += possible.charAt(Math.floor(Math.random() * 62));
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return text;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
};
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res) => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// logging
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
logger.info('Claim update request:', {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
ip,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
headers,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
body,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
files,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
user,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// check for disabled publishing
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (disabled) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return res.status(503).json({
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
success: false,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
message: disabledMessage,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// define variables
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
let channelName,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
channelId,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
channelPassword,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
description,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
fileName,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
filePath,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
fileType,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
gaStartTime,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
thumbnail,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
fileExtension,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
license,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
name,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
nsfw,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
thumbnailFileName,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
thumbnailFilePath,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
thumbnailFileType,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
title,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
claimRecord,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
metadata,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishResult,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
thumbnailUpdate = false;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// record the start time of the request
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
gaStartTime = Date.now();
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
try {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
({name, nsfw, license, title, description, thumbnail} = parsePublishApiRequestBody(body));
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
({fileName, filePath, fileExtension, fileType, thumbnailFileName, thumbnailFilePath, thumbnailFileType} = parsePublishApiRequestFiles(files, true));
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
({channelName, channelId, channelPassword} = body);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
} catch (error) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return res.status(400).json({success: false, message: error.message});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// check channel authorization
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
authenticateUser(channelName, channelId, channelPassword, user)
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
.then(({ channelName, channelClaimId }) => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (!channelId) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
channelId = channelClaimId;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return chainquery.claim.queries.resolveClaimInChannel(name, channelClaimId).then(claim => claim.dataValues);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
})
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
.then(claim => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
claimRecord = claim;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (claimRecord.content_type === 'video/mp4' && files.file) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
thumbnailUpdate = true;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (!files.file || thumbnailUpdate) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return Promise.all([
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
db.File.findOne({ where: { name, claimId: claim.claim_id } }),
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
resolveUri(`${claim.name}#${claim.claim_id}`),
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
]);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return [null, null];
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
})
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
.then(([fileResult, resolution]) => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
metadata = Object.assign({}, {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
title : claimRecord.title,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
description: claimRecord.description,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
nsfw : claimRecord.nsfw,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
license : claimRecord.license,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
language : 'en',
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
author : details.title,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}, updateMetadata({title, description, nsfw, license}));
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const publishParams = {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
name,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
bid : '0.01',
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
claim_address: primaryClaimAddress,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
channel_name : channelName,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
channel_id : channelId,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
metadata,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
};
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (files.file) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (thumbnailUpdate) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// publish new thumbnail
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const newThumbnailName = `${name}-${rando()}`;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const newThumbnailParams = createThumbnailPublishParams(filePath, newThumbnailName, license, nsfw);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
newThumbnailParams['file_path'] = filePath;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publish(newThumbnailParams, fileName, fileType);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishParams['sources'] = resolution.claim.value.stream.source;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishParams['thumbnail'] = `${details.host}/${newThumbnailParams.channel_name}:${newThumbnailParams.channel_id}/${newThumbnailName}-thumb.jpg`;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
} else {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishParams['file_path'] = filePath;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
} else {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
fileName = fileResult.fileName;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
fileType = fileResult.fileType;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishParams['sources'] = resolution.claim.value.stream.source;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishParams['thumbnail'] = claimRecord.thumbnail_url;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const fp = files && files.file && files.file.path ? files.file.path : undefined;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return publish(publishParams, fileName, fileType, fp);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
})
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
.then(result => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
publishResult = result;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (channelName) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return chainquery.claim.queries.getShortClaimIdFromLongClaimId(result.certificateId, channelName);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
} else {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return chainquery.claim.queries.getShortClaimIdFromLongClaimId(result.claimId, name, result).catch(error => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
return result.claimId.slice(0, 1);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
})
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
.then(shortId => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
let canonicalUrl;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (channelName) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
canonicalUrl = createCanonicalLink({ asset: { ...publishResult, channelShortId: shortId } });
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
} else {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
canonicalUrl = createCanonicalLink({ asset: { ...publishResult, shortId } })
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
if (publishResult.error) {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
res.status(400).json({
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
success: false,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
message: publishResult.message,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
}
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
const {claimId} = publishResult;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
res.status(200).json({
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
success: true,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
message: 'update successful',
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
data : {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
name,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
claimId,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
url : `${details.host}${canonicalUrl}`, // for backwards compatability with app
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
showUrl : `${details.host}${canonicalUrl}`,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
serveUrl: `${details.host}${canonicalUrl}${fileExtension}`,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
pushTo : canonicalUrl,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
claimData: publishResult,
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
},
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
// record the publish end time and send to google analytics
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
sendGATimingEvent('end-to-end', 'update', fileType, gaStartTime, Date.now());
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
})
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
.catch(error => {
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
handleErrorResponse(originalUrl, ip, error, res);
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
});
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
};
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases
module.exports = claimUpdate;
kauffj commented 2018-09-25 15:45:39 +02:00 (Migrated from github.com)
Review

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config

Can be filed, but this is a rather important value that ought to be hoisted all the way to a site-specific config
daovist commented 2018-09-26 21:15:40 +02:00 (Migrated from github.com)
Review
#609
skhameneh commented 2018-11-08 22:55:00 +01:00 (Migrated from github.com)
Review

Use aliases

Use aliases

View file

@ -2,6 +2,7 @@ const axios = require('axios');
const logger = require('winston');
const { apiHost, apiPort, getTimeout } = require('@config/lbryConfig');
const lbrynetUri = 'http://' + apiHost + ':' + apiPort;
const db = require('../models');
const { chooseGaLbrynetPublishLabel, sendGATimingEvent } = require('../utils/googleAnalytics.js');
const handleLbrynetResponse = require('./utils/handleLbrynetResponse.js');
const { publishing } = require('@config/siteConfig');
@ -46,6 +47,21 @@ module.exports = {
});
});
},
async abandonClaim ({claimId}) {
logger.debug(`lbryApi >> Abandon claim "${claimId}"`);
const gaStartTime = Date.now();
try {
const abandon = await axios.post(lbrynetUri, {
method: 'claim_abandon',
params: { claim_id: claimId },
});
sendGATimingEvent('lbrynet', 'abandonClaim', 'ABANDON_CLAIM', gaStartTime, Date.now());
return abandon.data;
} catch (error) {
logger.error(error);
return error;
}
},
getClaimList (claimName) {
logger.debug(`lbryApi >> Getting claim_list for "${claimName}"`);
const gaStartTime = Date.now();
@ -75,7 +91,13 @@ module.exports = {
})
.then(({ data }) => {
sendGATimingEvent('lbrynet', 'resolveUri', 'RESOLVE', gaStartTime, Date.now());
if (data.result[uri].error) { // check for errors
if (Object.keys(data.result).length === 0 && data.result.constructor === Object) {
// workaround for daemon returning empty result object
// https://github.com/lbryio/lbry/issues/1485
db.Claim.findOne({ where: { claimId: uri.split('#')[1] } })
.then(() => reject('This claim has not yet been confirmed on the LBRY blockchain'))
.catch(() => reject(`Claim ${uri} does not exist`));
} else if (data.result[uri].error) { // check for errors
reject(data.result[uri].error);
} else { // if no errors, resolve
resolve(data.result[uri]);

View file

@ -28,7 +28,7 @@ async function createFileRecordDataAfterGet (resolveResult, getResult) {
filePath,
fileType,
};
};
}
async function createFileRecordDataAfterPublish (fileName, fileType, publishParams, publishResults) {
const {

View file

@ -13,6 +13,8 @@ const claimGet = require('../../controllers/api/claim/get');
const claimList = require('../../controllers/api/claim/list');
const claimLongId = require('../../controllers/api/claim/longId');
const claimPublish = require('../../controllers/api/claim/publish');
const claimAbandon = require('../../controllers/api/claim/abandon');
const claimUpdate = require('../../controllers/api/claim/update');
const claimResolve = require('../../controllers/api/claim/resolve');
const claimShortId = require('../../controllers/api/claim/shortId');
const claimViews = require('../../controllers/api/claim/views');
@ -29,12 +31,10 @@ const getOEmbedData = require('../../controllers/api/oEmbed');
module.exports = {
// homepage routes
'/api/homepage/data/channels': { controller: [ torCheckMiddleware, channelData ] },
// channel routes
'/api/channel/availability/:name': { controller: [ torCheckMiddleware, channelAvailability ] },
'/api/channel/short-id/:longId/:name': { controller: [ torCheckMiddleware, channelShortId ] },
'/api/channel/data/:channelName/:channelClaimId': { controller: [ torCheckMiddleware, channelData ] },
'/api/channel/data/:channelName/:channelClaimId': { controller: [ torCheckMiddleware, channelData ] },
'/api/channel/claims/:channelName/:channelClaimId/:page': { controller: [ torCheckMiddleware, channelClaims ] },
// sepcial routes
@ -47,6 +47,8 @@ module.exports = {
'/api/claim/list/:name': { controller: [ torCheckMiddleware, claimList ] },
'/api/claim/long-id': { method: 'post', controller: [ torCheckMiddleware, claimLongId ] }, // note: should be a 'get'
'/api/claim/publish': { method: 'post', controller: [ torCheckMiddleware, autoblockPublishMiddleware, multipartMiddleware, autoblockPublishBodyMiddleware, claimPublish ] },
'/api/claim/update': { method: 'post', controller: [ torCheckMiddleware, multipartMiddleware, claimUpdate ] },
'/api/claim/abandon': { method: 'post', controller: [ torCheckMiddleware, multipartMiddleware, claimAbandon ] },
'/api/claim/resolve/:name/:claimId': { controller: [ torCheckMiddleware, claimResolve ] },
'/api/claim/short-id/:longId/:name': { controller: [ torCheckMiddleware, claimShortId ] },
'/api/claim/views/:claimId': { controller: [ torCheckMiddleware, claimViews ] },

View file

@ -15,6 +15,7 @@ module.exports = {
'/trending': { controller: redirect('/popular') },
'/popular': { controller: handlePageRequest },
'/new': { controller: handlePageRequest },
'/edit/:claimId': { controller: handlePageRequest },
'/multisite': { controller: handlePageRequest },
'/video-embed/:name/:claimId/:config?': { controller: handleVideoEmbedRequest }, // for twitter
};

View file

@ -0,0 +1,25 @@
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
const chainquery = require('chainquery');
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
const db = require('server/models');
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
const fetchClaimData = async (params) => {
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
let { claimId, claimName: name } = params;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
if (claimId === 'none') claimId = null;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
const [cq, local] = await Promise.all([
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
chainquery.claim.queries.resolveClaim(name, claimId).then(res => res.dataValues).catch(() => {}),
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
db.Claim.resolveClaim(name, claimId).catch(() => {}),
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
]);
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
if (!cq && !local) {
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
return null;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
}
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
if (cq && cq.name === name && !local) {
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
return cq;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
}
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
if (local && local.name === name && !cq) {
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
return local;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
}
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
return local.updatedAt > cq.modified_at ? local : cq;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
};
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.
module.exports = fetchClaimData;
skhameneh commented 2018-11-08 22:55:56 +01:00 (Migrated from github.com)
Review

I'd much prefer to avoid single line if logic, I find it reduced legibility.

I'd much prefer to avoid single line `if` logic, I find it reduced legibility.

View file

@ -25,7 +25,7 @@ module.exports = async (data) => {
claimId: data.claim_id || data.claimId,
fileExt: data.generated_extension || data.fileExt,
description: data.description,
thumbnail: data.generated_thumbnail || data.thumbnail,
thumbnail: data.generated_thumbnail || data.thumbnail_url || data.thumbnail,
outpoint: data.transaction_hash_id || data.outpoint,
host,
})