File tree 2 files changed +11
-13
lines changed
2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " youtube-music" ,
3
3
"productName" : " YouTube Music" ,
4
- "version" : " 1.7.1 " ,
4
+ "version" : " 1.7.2 " ,
5
5
"description" : " YouTube Music Desktop App - including custom plugins" ,
6
6
"license" : " MIT" ,
7
7
"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
2
2
const path = require ( "path" ) ;
3
3
4
4
const { ElectronBlocker } = require ( "@cliqz/adblocker-electron" ) ;
@@ -13,17 +13,15 @@ const loadAdBlockerEngine = (
13
13
cache = true ,
14
14
additionalBlockLists = [ ]
15
15
) => {
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 ;
27
25
28
26
ElectronBlocker . fromLists (
29
27
fetch ,
You can’t perform that action at this time.
0 commit comments