mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 04:11:47 +00:00
feat(api-server): add endpoint to get shuffle state (#2792)
This commit is contained in:
@ -80,6 +80,20 @@ async function onApiLoaded() {
|
||||
>('ytmusic-player-bar')
|
||||
?.queue.shuffle();
|
||||
});
|
||||
|
||||
const isShuffled = () => {
|
||||
const isShuffled =
|
||||
document
|
||||
.querySelector<HTMLElement>('ytmusic-player-bar')
|
||||
?.attributes.getNamedItem('shuffle-on') ?? null;
|
||||
|
||||
return isShuffled !== null;
|
||||
};
|
||||
|
||||
window.ipcRenderer.on('ytmd:get-shuffle', () => {
|
||||
window.ipcRenderer.send('ytmd:get-shuffle-response', isShuffled());
|
||||
});
|
||||
|
||||
window.ipcRenderer.on(
|
||||
'ytmd:update-like',
|
||||
(_, status: 'LIKE' | 'DISLIKE' = 'LIKE') => {
|
||||
|
||||
Reference in New Issue
Block a user