fix(mpris): fix mpris invalid position

- fix #1726
This commit is contained in:
JellyBrick
2024-02-18 10:26:45 +09:00
parent fbc02a494a
commit 8457115105
3 changed files with 114 additions and 40 deletions

View File

@ -29,8 +29,9 @@ export const setupTimeChangedListener = singleton(() => {
const progressObserver = new MutationObserver((mutations) => {
for (const mutation of mutations) {
const target = mutation.target as Node & { value: string };
window.ipcRenderer.send('ytmd:time-changed', target.value);
songInfo.elapsedSeconds = Number(target.value);
const numberValue = Number(target.value);
window.ipcRenderer.send('ytmd:time-changed', numberValue);
songInfo.elapsedSeconds = numberValue;
}
});
const progressBar = document.querySelector('#progress-bar');