module.exports = torrentPoster var captureVideoFrame = require('./capture-video-frame') var path = require('path') function torrentPoster (torrent, cb) { // First, try to use a poster image if available var posterFile = torrent.files.filter(function (file) { return /^poster\.(jpg|png|gif)$/.test(file.name) })[0] if (posterFile) return torrentPosterFromImage(posterFile, torrent, cb) // Second, try to use the largest video file // Filter out file formats that the