mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-19 20:32:04 +00:00
fix: subtitles not working
fix: some performance flags potentially not working feat: log renderer output in .log files
This commit is contained in:
parent
98a9c25ada
commit
248ff4f3c1
4 changed files with 9 additions and 7 deletions
|
|
@ -245,16 +245,16 @@ export default class TorrentClient extends WebTorrent {
|
|||
case 'current': {
|
||||
if (data.data) {
|
||||
const torrent = await this.get(data.data.current.infoHash)
|
||||
if (!torrent) return
|
||||
if (!torrent || torrent.destroyed) return
|
||||
const found = torrent.files.find(file => file.path === data.data.current.path)
|
||||
if (!found) return
|
||||
if (!found || found._destroyed) return
|
||||
if (this.playerProcess) {
|
||||
this.playerProcess.kill()
|
||||
this.playerProcess = null
|
||||
}
|
||||
if (this.current) {
|
||||
this.current.removeAllListeners('stream')
|
||||
this.current.deselect()
|
||||
if (!this.current._destroyed) this.current.deselect()
|
||||
}
|
||||
this.parser?.destroy()
|
||||
found.select()
|
||||
|
|
|
|||
|
|
@ -175,8 +175,6 @@
|
|||
subs = null
|
||||
}
|
||||
current = file
|
||||
emit('current', current)
|
||||
client.send('current', { current: file, external: settings.value.enableExternal })
|
||||
if (!settings.value.enableExternal) {
|
||||
src = file.url
|
||||
subs = new Subtitles(video, files, current, handleHeaders)
|
||||
|
|
@ -190,6 +188,8 @@
|
|||
}
|
||||
client.on('externalWatched', watchedListener)
|
||||
}
|
||||
emit('current', current)
|
||||
client.send('current', { current: file, external: settings.value.enableExternal })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import log from 'electron-log'
|
|||
import { autoUpdater } from 'electron-updater'
|
||||
import { ipcMain } from 'electron'
|
||||
|
||||
log.initialize({ spyRendererConsole: true })
|
||||
log.transports.file.level = 'info'
|
||||
autoUpdater.logger = log
|
||||
ipcMain.on('update', () => {
|
||||
|
|
|
|||
|
|
@ -6,15 +6,16 @@ export const development = process.env.NODE_ENV?.trim() === 'development'
|
|||
const flags = [
|
||||
// not sure if safe?
|
||||
['disable-gpu-sandbox'], ['disable-direct-composition-video-overlays'], ['double-buffer-compositing'], ['enable-zero-copy'], ['ignore-gpu-blocklist'],
|
||||
['force_high_performance_gpu'],
|
||||
// should be safe
|
||||
['enable-hardware-overlays', 'single-fullscreen,single-on-top,underlay'],
|
||||
// safe performance stuff
|
||||
['enable-features', 'PlatformEncryptedDolbyVision,CanvasOopRasterization,ThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframes,UseSkiaRenderer,WebAssemblyLazyCompilation'],
|
||||
['disable-renderer-backgrounding'],
|
||||
// disabling shit, vulkan rendering, widget layering aka right click context menus [I think] for macOS [I think]
|
||||
['disable-features', 'Vulkan,WidgetLayering'],
|
||||
// utility stuff, aka website security that's useless for a native app:
|
||||
['autoplay-policy', 'no-user-gesture-required'], ['disable-notifications'], ['disable-logging'], ['disable-permissions-api'], ['no-sandbox'], ['no-zygote'], ['bypasscsp-schemes'],
|
||||
['force_high_performance_gpu', 'disable-renderer-backgroundin']
|
||||
['autoplay-policy', 'no-user-gesture-required'], ['disable-notifications'], ['disable-logging'], ['disable-permissions-api'], ['no-sandbox'], ['no-zygote'], ['bypasscsp-schemes']
|
||||
]
|
||||
for (const [flag, value] of flags) {
|
||||
app.commandLine.appendSwitch(flag, value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue