From 98296c1ede65c85ac8d0bb4d7ed5fbc95566bf1b Mon Sep 17 00:00:00 2001 From: OldHawk Date: Thu, 17 Aug 2017 17:32:32 +0800 Subject: [PATCH] feat(torrents): test scrape torrent info when create new torrent record --- config/env/torrents.js | 2 +- .../server/controllers/torrents.server.controller.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 5cdedfe5..1054971e 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -18,7 +18,7 @@ module.exports = { admin: 'admin@chd.im', base_url: 'http://chd.im:3000', client_black_list_url: 'http://chd.im:3000/client_black_list', - private_torrent_cms: true + private_torrent_cms: false }, ircAnnounce: { enable: true, diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 475322e5..0a25bb9c 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -18,6 +18,7 @@ var path = require('path'), fs = require('fs'), nt = require('nt'), benc = require('bncode'), + scrape = require(path.resolve('./config/lib/scrape')), async = require('async'), validator = require('validator'), tmdb = require('moviedb')(config.meanTorrentConfig.tmdbConfig.key), @@ -985,6 +986,15 @@ exports.torrentByID = function (req, res, next, id) { } else { req.torrent = torrent; next(); + + scrape.doScrape(torrent, function (err, res) { + if (err) { + console.log(err); + } + if (res) { + console.log(res); + } + }); } }); };