Only show play button for torrents that are playable

This commit is contained in:
DC
2016-04-06 02:24:50 -07:00
parent 08a806a643
commit aac862cddf
2 changed files with 16 additions and 3 deletions

View File

@@ -137,14 +137,22 @@ function TorrentList (state) {
downloadTooltip = 'Click to start torrenting.'
}
return hx`
<div class='buttons'>
// Only show the play button for torrents that contain playable media
var playButton
if (TorrentPlayer.isPlayableTorrent(torrentSummary)) {
playButton = hx`
<i.btn.icon.play
title=${playTooltip}
class=${playClass}
onclick=${dispatcher('play', infoHash)}>
${playIcon}
</i>
`
}
return hx`
<div class='buttons'>
${playButton}
<i.btn.icon.download
class=${torrentSummary.status}
title=${downloadTooltip}