fix: callback for time-changed event (#2577)

Co-authored-by: Derek Alsop <15299183+Azorant@users.noreply.github.com>
This commit is contained in:
JellyBrick
2024-11-03 19:18:06 +09:00
committed by GitHub
parent 516fbff3d7
commit 1e4cd699db
13 changed files with 137 additions and 91 deletions

View File

@ -30,7 +30,7 @@ export default createPlugin({
config: {
enabled: false,
},
backend() {
backend({ ipc }) {
const secToMilisec = (t?: number) =>
t ? Math.round(Number(t) * 1e3) : undefined;
const previousStatePaused = null;
@ -65,6 +65,10 @@ export default createPlugin({
});
};
ipc.on('ytmd:player-api-loaded', () =>
ipc.send('ytmd:setup-time-changed-listener'),
);
registerCallback((songInfo) => {
if (!songInfo.title && !songInfo.artist) {
return;