Skip to content

Commit 2140f67

Browse files
committed
v17.3.9
- Improved HLS playback. - Better control of disk space usage. - An option has also been added to customize the use of disk space for caching, in Options > Advanced > Developer Options > Enable disk cache. - Better compatibility with recent versions of Electron. - Minor bugfixes and improvements.
1 parent db236ca commit 2140f67

40 files changed

+860
-896
lines changed

www/nodejs-project/assets/custom-frame/custom-frame.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ class CustomFrame {
132132
var iconClose = document.createElement('i');
133133
iconClose.setAttribute('class', options.classes.icons.close);
134134
buttonClose.appendChild(iconClose);
135-
var size = options.win.getSize();
136-
var initialPosX = options.win.x, initialPosY = options.win.y;
135+
var size = options.win.getSize()
136+
var position = options.win.getPosition()
137+
var initialPosX = position[0], initialPosY = position[1]
137138
var initialSizeW = size[0], initialSizeH = size[1];
138139
if (options.customFrameState === 'maximized') {
139140
buttonMaximize.setAttribute('style', buttonMaximize.getAttribute('style') === null ? 'display: none;' : buttonMaximize.getAttribute('style') + 'display: none;');
@@ -182,8 +183,9 @@ class CustomFrame {
182183
});
183184
options.win.on('close', function () {
184185
if (that.window.localStorage.customFrameState !== 'maximized') {
185-
that.window.localStorage.customFramePosX = options.win.x;
186-
that.window.localStorage.customFramePosY = options.win.y;
186+
const position = options.win.getPosition(), size = options.win.getSize()
187+
that.window.localStorage.customFramePosX = position[0];
188+
that.window.localStorage.customFramePosY = position[1];
187189
that.window.localStorage.customFrameSizeW = size[0];
188190
that.window.localStorage.customFrameSizeH = size[1];
189191
}
@@ -196,20 +198,21 @@ class CustomFrame {
196198
});
197199
buttonMinimize.addEventListener('click', function () {
198200
options.win.minimize();
199-
});
201+
}, {passive: true});
200202
buttonMaximize.addEventListener('click', function () {
201-
initialPosX = options.win.x;
202-
initialPosY = options.win.y;
203+
const position = options.win.getPosition()
204+
initialPosX = position[0];
205+
initialPosY = position[1];
203206
initialSizeW = size[0];
204207
initialSizeH = size[1];
205208
options.win.maximize();
206-
});
209+
}, {passive: true});
207210
buttonRestore.addEventListener('click', function () {
208211
options.win.restore();
209-
});
212+
}, {passive: true});
210213
buttonClose.addEventListener('click', function () {
211214
options.win.close();
212-
});
215+
}, {passive: true});
213216

214217
this.createElement('link', { href: options.style, rel: 'stylesheet', type: 'text/css' }, null, that.document.head);
215218
this.createElement('link', { href: options.uiIconsTheme, rel: 'stylesheet', type: 'text/css' }, null, that.document.head);

www/nodejs-project/assets/js/app/app.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var body = $('body'), content = $('#explorer content'), wrap = document.querySelector('#explorer wrap'), wrapper = $(wrap)
1+
var body = jQuery('body'), content = jQuery('#explorer content'), wrap = document.querySelector('#explorer wrap'), wrapper = jQuery(wrap)
22

33
function importMomentLocale(locale, cb){
44
importMomentLocaleCallback = cb
@@ -218,7 +218,7 @@ function initApp(){
218218
app.on('background-mode-unlock', name => {
219219
if(parent.player && parent.winman) parent.winman && parent.winman.backgroundModeUnlock(name)
220220
});
221-
$(() => {
221+
jQuery(() => {
222222
console.log('load app')
223223
if(typeof(Explorer) == 'undefined') {
224224
parent.updateWebView()
@@ -421,7 +421,7 @@ function initApp(){
421421
explorer.reset()
422422
}
423423
}, 100)
424-
}, true)
424+
}, {passive: true})
425425

426426
explorer.on('prompt-start', explorer.reset.bind(explorer))
427427
explorer.on('ask-start', explorer.reset.bind(explorer))
@@ -446,7 +446,7 @@ function initApp(){
446446
break
447447
}
448448
}
449-
})
449+
}, {passive: true})
450450

451451
langUpdated()
452452
app.emit('init')
@@ -501,7 +501,7 @@ function initApp(){
501501
haUpdate()
502502
})
503503

504-
var elp = $('.explorer-location-pagination'), elpTxt = elp.find('span'), elpTimer = 0, elpDuration = 5000, elpShown = false
504+
var elp = jQuery('.explorer-location-pagination'), elpTxt = elp.find('span'), elpTimer = 0, elpDuration = 5000, elpShown = false
505505
const elpShow = txt => {
506506
clearTimeout(elpTimer)
507507
if(!elpShown){
@@ -528,7 +528,7 @@ function initApp(){
528528
explorer.on('focus', elpListener)
529529
explorer.on('render', elpListener)
530530

531-
var haTop = $('#home-arrows-top'), haBottom = $('#home-arrows-bottom')
531+
var haTop = jQuery('#home-arrows-top'), haBottom = jQuery('#home-arrows-bottom')
532532
haTop.on('click', () => explorer.arrow('up'))
533533
haBottom.on('click', () => explorer.arrow('down'))
534534

@@ -679,15 +679,21 @@ function initApp(){
679679
}
680680
})
681681

682-
var parentRoot = jQuery(parent.document.documentElement)
683-
var energySaver = {
682+
const parentRoot = jQuery(parent.document.documentElement)
683+
const energySaver = {
684+
active: false,
684685
start: () => {
686+
if(energySaver.active || typeof(config) == 'undefined' || !config['timeout-secs-energy-saving']) return
687+
energySaver.active = true
685688
parent.animateBackground('none')
686-
parentRoot.addClass('curtains curtains-alpha').removeClass('curtains-close')
689+
parent.player.closeCurtains(true, false)
687690
},
688691
end: () => {
689-
typeof(config) != 'undefined' && parent.animateBackground(config['animate-background'])
690-
parentRoot.addClass('curtains-close curtains-alpha').removeClass('curtains')
692+
if(!energySaver.active || typeof(config) == 'undefined' || !config['timeout-secs-energy-saving']) return
693+
energySaver.active = false
694+
parent.player.openCurtains(true, true, () => {
695+
typeof(config) != 'undefined' && parent.animateBackground(config['animate-background'])
696+
})
691697
}
692698
}
693699
idle.on('idle', () => {
@@ -701,7 +707,7 @@ function initApp(){
701707
streamer.active || streamer.isTuning() || energySaver.start()
702708
})
703709
idle.on('active', () => energySaver.end())
704-
streamer.on('show', () => energySaver.start())
710+
streamer.on('show', () => parent.animateBackground('none'))
705711
streamer.on('hide', () => {
706712
idle.reset() // will not call idle.on('active') if not idle, so keep lines below to ensure
707713
energySaver.end()
@@ -714,13 +720,13 @@ function initApp(){
714720
hs.title = hs.alt = lang.EXIT
715721
hs.addEventListener('click', () => {
716722
parent.winman && parent.winman.askExit()
717-
})
723+
}, {passive: true})
718724

719725
let ha = document.getElementById('header-about')
720726
ha.title = ha.alt = lang.ABOUT
721727
ha.addEventListener('click', () => {
722728
app.emit('about-dialog')
723-
})
729+
}, {passive: true})
724730

725731
ha = hs = undefined
726732

@@ -756,7 +762,7 @@ function initApp(){
756762
} else {
757763
parent.addEventListener('load', () => {
758764
parent.appChannel.localEmit('frontend')
759-
})
765+
}, {once: true, passive: true})
760766
}
761767
})
762768
}

0 commit comments

Comments
 (0)