diff --git a/app/js/playerHandler.js b/app/js/playerHandler.js index 1a8f674..04676b1 100644 --- a/app/js/playerHandler.js +++ b/app/js/playerHandler.js @@ -415,7 +415,7 @@ function btnnext() { } function autoNext() { updateBar(video.currentTime / video.duration * 100) - settings.player6 ? btnnext() : "" + if (settings.player6) btnnext() } // volume shit diff --git a/app/js/subtitleOctopus.js b/app/js/subtitleOctopus.js index cfbe9b7..fbaf8ef 100644 --- a/app/js/subtitleOctopus.js +++ b/app/js/subtitleOctopus.js @@ -48,7 +48,7 @@ function subStream(stream) { // subtitle parsing with seeking support } }) playerData.subtitleStream.on('file', file => { - file.mimetype == ("application/x-truetype-font" || "application/font-woff") ? playerData.fonts.push(window.URL.createObjectURL(new Blob([file.data], { type: file.mimetype }))) : "" + if (file.mimetype == ("application/x-truetype-font" || "application/font-woff")) playerData.fonts.push(window.URL.createObjectURL(new Blob([file.data], { type: file.mimetype }))) }) stream.pipe(playerData.subtitleStream) } @@ -105,7 +105,7 @@ function postDownload(file) { // parse subtitles fully after a download is finis playState = !video.paused video.src = url video.currentTime = time - playState ? video.play() : "" + if (playState) video.play() }, 5000); }) } diff --git a/app/js/torrentHandler.js b/app/js/torrentHandler.js index b1f7c42..7f70724 100644 --- a/app/js/torrentHandler.js +++ b/app/js/torrentHandler.js @@ -6,9 +6,9 @@ let client = new WebTorrent({ maxConns: settings.torrent6 }), } window.onbeforeunload = () => { //cleanup shit before unloading to free RAM/drive if (!settings.torrent8) { - client.torrents[0] ? client.torrents[0].store.destroy() : "" + if (client.torrents[0]) client.torrents[0].store.destroy() } - client.torrents[0] ? client.torrents[0].destroy() : "" + if (client.torrents[0]) client.torrents[0].destroy() client.destroy() cleanupVideo() if (playerData.fonts) { @@ -77,7 +77,7 @@ async function addTorrent(magnet, media, episode) { if (settings.torrent8 && settings.torrent5) { client.remove(client.torrents[0].infoHash) } else { - client.torrents[0].store ? client.torrents[0].store.destroy() : "" + if (client.torrents[0].store) client.torrents[0].store.destroy() client.torrents[0].destroy() } } @@ -117,7 +117,7 @@ async function addTorrent(magnet, media, episode) { alertType: "alert-danger", fillType: "" }); - client.torrents[0].store ? client.torrents[0].store.destroy() : "" + if (client.torrents[0].store) client.torrents[0].store.destroy() client.torrents[0].destroy() }