Skip to content

Commit

Permalink
fix(MPRIS): Prevents player to start with invalid MPRIS interface (#1996
Browse files Browse the repository at this point in the history
)

Co-authored-by: andreas <[email protected]>
  • Loading branch information
andia89 and andreas authored May 24, 2024
1 parent bbd10b6 commit eaf9d31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/shortcuts/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BrowserWindow, globalShortcut } from 'electron';
import { BrowserWindow, ipcMain, globalShortcut } from 'electron';
import is from 'electron-is';
import { register as registerElectronLocalShortcut } from 'electron-localshortcut';

Expand Down Expand Up @@ -48,7 +48,9 @@ export const onMainLoad = async ({
_registerLocalShortcut(window, 'CommandOrControl+L', search);

if (is.linux()) {
registerMPRIS(window);
ipcMain.once('ytmd:video-src-changed', (_) => {
registerMPRIS(window);
});
}

const { global, local } = config;
Expand Down

0 comments on commit eaf9d31

Please sign in to comment.