From ed324d01d275d8f76c2baa1999d453fe67f4e8d4 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Tue, 3 Jan 2017 11:10:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=87=D0=B8=D1=81=D0=BA=D0=B0=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D1=85=20=D0=BB=D0=BE=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/content.js | 4 ---- patches/patch1.js | 9 ++++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/content.js b/lib/content.js index 60bfdf3..f0431c2 100644 --- a/lib/content.js +++ b/lib/content.js @@ -181,7 +181,6 @@ const fileDetect = (file) => { if(extension.length == 0) return; - console.log(name + ':' + extension); return ExtesionBase[extension]; } @@ -206,9 +205,6 @@ const torrentTypeDetect = (torrent, files) => { }); if(priority.length > 0) torrent[ContentTypeProp] = priority[0]; - - console.log(typesPriority); - console.log(priority); } module.exports = torrentTypeDetect; \ No newline at end of file diff --git a/patches/patch1.js b/patches/patch1.js index 3558c54..d5476ef 100644 --- a/patches/patch1.js +++ b/patches/patch1.js @@ -16,18 +16,17 @@ socketMysql.connect(function(mysqlError) { return; } - socketMysql.query('SELECT * FROM `torrents` WHERE `contentType` IS NULL', function (error, rows, fields) { - rows.forEach((torrent) => { + let inc = 0; + socketMysql.query('SELECT * FROM `torrents` WHERE `contentType` IS NULL', function (error, torrents, fields) { + torrents.forEach((torrent) => { socketMysql.query('SELECT * FROM `files` WHERE hash = ?', torrent.hash, function (error, files, fields) { torrentTypeDetect(torrent, files); if(torrent.contentType) { socketMysql.query('UPDATE `torrents` SET `contentType` = ? WHERE `hash` = ?', [torrent.contentType, torrent.hash], function (error, files, fields) { - console.log(error + ':' + torrent.contentType); + console.log((++inc) + '/' + torrents.length); }); } }); }); }); }); - -console.log('end'); \ No newline at end of file