не воспринимаем расширения

This commit is contained in:
Alexey Kasyanchuk
2017-01-23 23:28:29 +03:00
parent 51a6cad3f1
commit 2106168147

View File

@ -258,7 +258,12 @@ const detectSubCategory = (torrent, files, typesPriority, contentType) => {
if(torrent[ContentCategoryProp] != 'xxx') if(torrent[ContentCategoryProp] != 'xxx')
{ {
files.some(({path}) => { 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') if(torrent[ContentCategoryProp] == 'xxx')
{ {
console.log('block because file ' + path); console.log('block because file ' + path);