Only show play button for torrents that are playable
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
module.exports = {
|
||||
isPlayable,
|
||||
isVideo,
|
||||
isAudio
|
||||
isAudio,
|
||||
isPlayableTorrent
|
||||
}
|
||||
|
||||
var path = require('path')
|
||||
@@ -22,3 +23,7 @@ function isAudio (file) {
|
||||
var ext = path.extname(file.name)
|
||||
return ['.mp3', '.aac', '.ogg', '.wav'].indexOf(ext) !== -1
|
||||
}
|
||||
|
||||
function isPlayableTorrent (torrentSummary) {
|
||||
return torrentSummary.files && torrentSummary.files.some(isPlayable)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user