fix(MPRIS): Prevents player to start with invalid MPRIS interface (#1996)

Co-authored-by: andreas <andreas.angerer@github.com>
This commit is contained in:
Andreas Angerer
2024-05-25 01:36:52 +02:00
committed by GitHub
parent bbd10b657d
commit eaf9d310aa

View File

@ -1,4 +1,4 @@
import { BrowserWindow, globalShortcut } from 'electron'; import { BrowserWindow, ipcMain, globalShortcut } from 'electron';
import is from 'electron-is'; import is from 'electron-is';
import { register as registerElectronLocalShortcut } from 'electron-localshortcut'; import { register as registerElectronLocalShortcut } from 'electron-localshortcut';
@ -48,7 +48,9 @@ export const onMainLoad = async ({
_registerLocalShortcut(window, 'CommandOrControl+L', search); _registerLocalShortcut(window, 'CommandOrControl+L', search);
if (is.linux()) { if (is.linux()) {
registerMPRIS(window); ipcMain.once('ytmd:video-src-changed', (_) => {
registerMPRIS(window);
});
} }
const { global, local } = config; const { global, local } = config;