feat(filters): adult filter

This commit is contained in:
Alexey Kasyanchuk 2018-04-26 11:06:50 +03:00
parent aae2ddf458
commit 89a0e8689d
3 changed files with 22 additions and 1 deletions

View File

@ -115,6 +115,20 @@ export default class ConfigPage extends Page {
</div> </div>
</div> </div>
<Toggle
style={{marginTop: '10px'}}
label="Adult filter"
toggled={this.options.filters && this.options.filters.adultFilter}
onToggle={(e, checked) => {
if(!this.options.filters)
return
this.options.filters.adultFilter = checked
this.forceUpdate()
}}
/>
{ {
this.toRemoveProbably && this.toRemoveProbably > 0 this.toRemoveProbably && this.toRemoveProbably > 0
? ?

View File

@ -39,7 +39,8 @@ let config = {
filters: { filters: {
maxFiles: 0, maxFiles: 0,
namingRegExp: '' namingRegExp: '',
adultFilter: false,
}, },
cleanup: true, cleanup: true,

View File

@ -393,6 +393,12 @@ const checkTorrent = (torrent) => {
return false return false
} }
if(config.filters.adultFilter && torrent.contentCategory === 'xxx')
{
console.log('ignore torrent', torrent.name, 'because adult filter')
return false
}
return true return true
} }