From 2106168147af3e64209c648e8d0f94347d51ab5f Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Mon, 23 Jan 2017 23:28:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=20=D0=B2=D0=BE=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B8=D0=BC=D0=B0=D0=B5=D0=BC=20=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/content.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/content.js b/lib/content.js index 41bff94..c0593dd 100644 --- a/lib/content.js +++ b/lib/content.js @@ -258,7 +258,12 @@ const detectSubCategory = (torrent, files, typesPriority, contentType) => { if(torrent[ContentCategoryProp] != 'xxx') { files.some(({path}) => { - blockBadName(torrent, path.toLowerCase()); + let fileCheck = path.toLowerCase().split('.'); + if(fileCheck.length > 1) + fileCheck.pop(); // убираем расширение на конце + fileCheck = fileCheck.join('.'); + + blockBadName(torrent, fileCheck); if(torrent[ContentCategoryProp] == 'xxx') { console.log('block because file ' + path); @@ -304,4 +309,4 @@ const torrentTypeDetect = (torrent, files) => { detectSubCategory(torrent, files, typesPriority, torrent[ContentTypeProp]); } -module.exports = torrentTypeDetect; \ No newline at end of file +module.exports = torrentTypeDetect;