File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed
Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " youtube-music" ,
33 "productName" : " YouTube Music" ,
4- "version" : " 1.7.1 " ,
4+ "version" : " 1.7.2 " ,
55 "description" : " YouTube Music Desktop App - including custom plugins" ,
66 "license" : " MIT" ,
77 "repository" : " th-ch/youtube-music" ,
Original file line number Diff line number Diff line change 1- const { existsSync , promises, unlinkSync } = require ( "fs" ) ; // used for caching
1+ const { promises } = require ( "fs" ) ; // used for caching
22const path = require ( "path" ) ;
33
44const { ElectronBlocker } = require ( "@cliqz/adblocker-electron" ) ;
@@ -13,17 +13,15 @@ const loadAdBlockerEngine = (
1313 cache = true ,
1414 additionalBlockLists = [ ]
1515) => {
16- const adBlockerCache = path . resolve ( __dirname , "ad-blocker-engine.bin" ) ;
17- if ( ! cache && existsSync ( adBlockerCache ) ) {
18- unlinkSync ( adBlockerCache ) ;
19- }
20- const cachingOptions = cache
21- ? {
22- path : adBlockerCache ,
23- read : promises . readFile ,
24- write : promises . writeFile ,
25- }
26- : undefined ;
16+ // Only use cache if no additional blocklists are passed
17+ const cachingOptions =
18+ cache && additionalBlockLists . length === 0
19+ ? {
20+ path : path . resolve ( __dirname , "ad-blocker-engine.bin" ) ,
21+ read : promises . readFile ,
22+ write : promises . writeFile ,
23+ }
24+ : undefined ;
2725
2826 ElectronBlocker . fromLists (
2927 fetch ,
You can’t perform that action at this time.
0 commit comments