eslint
This commit is contained in:
@ -25,14 +25,14 @@ let parseDescriptionText = (text) => {
|
||||
const text = /(.+?:)(.*)/.exec(item)
|
||||
|
||||
return (
|
||||
<span>
|
||||
{
|
||||
text ? <span><b>{`${text[1]} `}</b>{text[2]}</span> : item
|
||||
}
|
||||
<br/>
|
||||
</span>
|
||||
<span>
|
||||
{
|
||||
text ? <span><b>{`${text[1]} `}</b>{text[2]}</span> : item
|
||||
}
|
||||
<br/>
|
||||
</span>
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
let buildFilesTree = (filesList) => {
|
||||
@ -203,10 +203,10 @@ export default class TorrentPage extends Page {
|
||||
}
|
||||
//this.forceUpdate(); // вызывается через searchingIndicator
|
||||
|
||||
// Получаем более новую статистику пира
|
||||
if((Date.now() / 1000) - this.torrent.trackersChecked > 10 * 60) {
|
||||
// Получаем более новую статистику пира
|
||||
if((Date.now() / 1000) - this.torrent.trackersChecked > 10 * 60) {
|
||||
window.torrentSocket.emit('checkTrackers', this.torrent.hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, () => {
|
||||
this.setState({
|
||||
@ -236,7 +236,7 @@ export default class TorrentPage extends Page {
|
||||
if(!this.torrent)
|
||||
return;
|
||||
|
||||
this.torrent = Object.assign(this.torrent, info);
|
||||
this.torrent = Object.assign(this.torrent, info);
|
||||
this.forceUpdate();
|
||||
}
|
||||
window.torrentSocket.on('trackerTorrentUpdate', this.trackerUpdate);
|
||||
@ -376,7 +376,7 @@ export default class TorrentPage extends Page {
|
||||
<div style={{flexBasis: '40%'}} className='column center w100p'>
|
||||
<img src={(this.torrent && this.torrent.info && this.torrent.info.poster) ? this.torrent.info.poster : NoImage} className='pad0-75' style={{height: '200px'}} />
|
||||
<TrackersImages info={this.torrent && this.torrent.info} className='column' />
|
||||
<RaisedButton
|
||||
<RaisedButton
|
||||
href={`magnet:?xt=urn:btih:${this.torrent.hash}`}
|
||||
target="_self"
|
||||
label="Magnet"
|
||||
@ -526,13 +526,13 @@ export default class TorrentPage extends Page {
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
this.torrent && this.torrent.info && this.torrent.info.description
|
||||
&&
|
||||
<div className='fs0-85' style={{width: '95%', padding: 15, margin: 20, boxShadow: 'rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px'}}>
|
||||
<div>{parseDescriptionText(this.torrent.info.description)}</div>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
this.torrent && this.torrent.info && this.torrent.info.description
|
||||
&&
|
||||
<div className='fs0-85' style={{width: '95%', padding: 15, margin: 20, boxShadow: 'rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px'}}>
|
||||
<div>{parseDescriptionText(this.torrent.info.description)}</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</Tab>
|
||||
<Tab label={__('Files')} value="files" >
|
||||
|
@ -251,7 +251,7 @@ export default class Torrent extends Component {
|
||||
{
|
||||
const torrent = this.props.torrent;
|
||||
if(!torrent)
|
||||
return null // can try draw null torrent (for example on downloading not started)
|
||||
return null // can try draw null torrent (for example on downloading not started)
|
||||
|
||||
let torrentRating = -1
|
||||
if(torrent.good > 0 || torrent.bad > 0)
|
||||
@ -262,8 +262,8 @@ export default class Torrent extends Component {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ListItem
|
||||
className='torrentRow'
|
||||
<ListItem
|
||||
className='torrentRow'
|
||||
innerDivStyle={{paddingRight: 84}}
|
||||
onClick={(e) => {
|
||||
const link = '/torrent/' + torrent.hash;
|
||||
@ -358,8 +358,8 @@ export default class Torrent extends Component {
|
||||
<div style={{marginLeft: 5, color: 'rgb(0, 188, 212)'}}>{this.state.downloadProgress && formatBytes(this.state.downloadProgress.downloadSpeed || 0, 0)}/s</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<TrackersImages info={torrent.info} className='row' />
|
||||
}
|
||||
<TrackersImages info={torrent.info} className='row' />
|
||||
</div>
|
||||
</a>
|
||||
}
|
||||
|
@ -6,23 +6,23 @@ import NyaaIcon from './images/strategies/nyaa.jpg'
|
||||
export default (props) => {
|
||||
let className = ''
|
||||
if(props.className)
|
||||
className += props.className
|
||||
const {info} = props
|
||||
if(!info)
|
||||
return null
|
||||
className += props.className
|
||||
const {info} = props
|
||||
if(!info)
|
||||
return null
|
||||
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
info.trackers.includes('rutracker')
|
||||
{
|
||||
info.trackers.includes('rutracker')
|
||||
&&
|
||||
<a href={`https://rutracker.org/forum/viewtopic.php?t=${info.rutrackerThreadId}`}><img src={RutrackerIcon} style={{height: 32}} /></a>
|
||||
}
|
||||
{
|
||||
info.trackers.includes('nyaa')
|
||||
}
|
||||
{
|
||||
info.trackers.includes('nyaa')
|
||||
&&
|
||||
<img src={NyaaIcon} style={{height: 32}} />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user