- function (callback) {
- videos.seed(videoFile.path, callback)
- },
-
- function seed (torrent, callback) {
- videos.getVideoDuration(videoFile.path, function (err, duration) {
- if (err) {
- // TODO: unseed the video
- logger.error('Cannot retrieve metadata of the file.')
- return next(err)
- }
-
- callback(null, torrent, duration)
- })
- },
-
- function createThumbnail (torrent, duration, callback) {
- videos.createVideoThumbnail(videoFile.path, function (err, thumbnailName) {
- if (err) {
- // TODO: unseed the video
- logger.error('Cannot make a thumbnail of the video file.')
- return callback(err)
- }
-
- callback(null, torrent, duration, thumbnailName)
- })
- },