feat(filters): adult filter
This commit is contained in:
parent
aae2ddf458
commit
89a0e8689d
@ -115,6 +115,20 @@ export default class ConfigPage extends Page {
|
||||
</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
|
||||
?
|
||||
|
@ -39,7 +39,8 @@ let config = {
|
||||
|
||||
filters: {
|
||||
maxFiles: 0,
|
||||
namingRegExp: ''
|
||||
namingRegExp: '',
|
||||
adultFilter: false,
|
||||
},
|
||||
|
||||
cleanup: true,
|
||||
|
@ -393,6 +393,12 @@ const checkTorrent = (torrent) => {
|
||||
return false
|
||||
}
|
||||
|
||||
if(config.filters.adultFilter && torrent.contentCategory === 'xxx')
|
||||
{
|
||||
console.log('ignore torrent', torrent.name, 'because adult filter')
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user