File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ fn load_requests() -> Vec<RequestRuleMatch> {
4646#[ derive( serde:: Deserialize , Debug ) ]
4747pub struct RemoteFilterCatalogEntry {
4848 pub title : String ,
49+ #[ serde( default ) ]
50+ pub default_enabled : bool ,
51+ #[ serde( default ) ]
52+ pub platforms : Vec < String > ,
4953 pub sources : Vec < RemoteFilterSource > ,
5054}
5155
@@ -83,8 +87,17 @@ static ALL_FILTERS: once_cell::sync::Lazy<std::sync::Mutex<adblock::lists::Filte
8387 }
8488 . await ;
8589
86- // 0th entry is the main default lists
87- let default_lists = & default_catalog[ 0 ] . sources ;
90+ let default_lists: Vec < _ > = default_catalog
91+ . iter ( )
92+ . filter ( |comp| comp. default_enabled )
93+ . filter ( |comp| {
94+ comp. platforms . is_empty ( )
95+ || comp. platforms . iter ( ) . any ( |platform| {
96+ [ "LINUX" , "WINDOWS" , "MAC" ] . contains ( & platform. as_str ( ) )
97+ } )
98+ } )
99+ . flat_map ( |comp| & comp. sources )
100+ . collect ( ) ;
88101
89102 assert ! ( default_lists. len( ) > 10 ) ; // sanity check
90103
You can’t perform that action at this time.
0 commit comments