mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-19 22:22:06 +00:00
feat(api-server): Improved api-server volume and like/dislike state (#3592)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: rewhex <gitea@cluser.local> Co-authored-by: JellyBrick <shlee1503@naver.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
// This is used for to control the songs
|
||||
import { type BrowserWindow, ipcMain } from 'electron';
|
||||
import { LikeType } from '@/types/datahost-get-state';
|
||||
|
||||
// see protocol-handler.ts
|
||||
type ArgsType<T> = T | string[] | undefined;
|
||||
@ -42,8 +43,8 @@ export default (win: BrowserWindow) => {
|
||||
play: () => win.webContents.send('ytmd:play'),
|
||||
pause: () => win.webContents.send('ytmd:pause'),
|
||||
playPause: () => win.webContents.send('ytmd:toggle-play'),
|
||||
like: () => win.webContents.send('ytmd:update-like', 'LIKE'),
|
||||
dislike: () => win.webContents.send('ytmd:update-like', 'DISLIKE'),
|
||||
like: () => win.webContents.send('ytmd:update-like', LikeType.Like),
|
||||
dislike: () => win.webContents.send('ytmd:update-like', LikeType.Dislike),
|
||||
seekTo: (seconds: ArgsType<number>) => {
|
||||
const secondsNumber = parseNumberFromArgsType(seconds);
|
||||
if (secondsNumber !== null) {
|
||||
|
||||
Reference in New Issue
Block a user