feat(filtering): negative name filter
This commit is contained in:
@ -40,6 +40,7 @@ let config = {
|
||||
filters: {
|
||||
maxFiles: 0,
|
||||
namingRegExp: '',
|
||||
namingRegExpNegative: false,
|
||||
adultFilter: false,
|
||||
},
|
||||
|
||||
|
@ -404,11 +404,16 @@ const checkTorrent = (torrent) => {
|
||||
if(nameRX && nameRX.length > 0)
|
||||
{
|
||||
const rx = new RegExp(nameRX)
|
||||
if(!rx.test(torrent.name))
|
||||
if(!config.filters.namingRegExpNegative && !rx.test(torrent.name))
|
||||
{
|
||||
console.log('ignore', torrent.name, 'by naming rx')
|
||||
return false
|
||||
}
|
||||
else if(config.filters.namingRegExpNegative && rx.test(torrent.name))
|
||||
{
|
||||
console.log('ignore', torrent.name, 'by naming rx negative')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if(torrent.contentType === 'bad')
|
||||
|
Reference in New Issue
Block a user