mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
fix: apply fix from eslint
This commit is contained in:
@ -3,33 +3,37 @@ import { BrowserWindow, ipcMain } from 'electron';
|
||||
|
||||
export default (win: BrowserWindow) => {
|
||||
const commands = {
|
||||
// Playback
|
||||
previous: () => win.webContents.send('ytmd:previous-video'),
|
||||
next: () => win.webContents.send('ytmd:next-video'),
|
||||
playPause: () => win.webContents.send('ytmd:toggle-play'),
|
||||
like: () => win.webContents.send('ytmd:update-like', 'LIKE'),
|
||||
dislike: () => win.webContents.send('ytmd:update-like', 'DISLIKE'),
|
||||
go10sBack: () => win.webContents.send('ytmd:seek-by', -10),
|
||||
go10sForward: () => win.webContents.send('ytmd:seek-by', 10),
|
||||
go1sBack: () => win.webContents.send('ytmd:seek-by', -1),
|
||||
go1sForward: () => win.webContents.send('ytmd:seek-by', 1),
|
||||
shuffle: () => win.webContents.send('ytmd:shuffle'),
|
||||
switchRepeat: (n = 1) => win.webContents.send('ytmd:switch-repeat', n),
|
||||
// General
|
||||
volumeMinus10: () => {
|
||||
ipcMain.once('ytmd:get-volume-return', (_, volume) => {
|
||||
win.webContents.send('ytmd:update-volume', volume - 10);
|
||||
});
|
||||
win.webContents.send('ytmd:get-volume');
|
||||
},
|
||||
volumePlus10: () => {
|
||||
ipcMain.once('ytmd:get-volume-return', (_, volume) => {
|
||||
win.webContents.send('ytmd:update-volume', volume + 10);
|
||||
});
|
||||
win.webContents.send('ytmd:get-volume');
|
||||
},
|
||||
fullscreen: () => win.webContents.send('ytmd:toggle-fullscreen'),
|
||||
muteUnmute: () => win.webContents.send('ytmd:toggle-mute'),
|
||||
// Playback
|
||||
previous: () => win.webContents.send('ytmd:previous-video'),
|
||||
next: () => win.webContents.send('ytmd:next-video'),
|
||||
playPause: () => win.webContents.send('ytmd:toggle-play'),
|
||||
like: () => win.webContents.send('ytmd:update-like', 'LIKE'),
|
||||
dislike: () => win.webContents.send('ytmd:update-like', 'DISLIKE'),
|
||||
go10sBack: () => win.webContents.send('ytmd:seek-by', -10),
|
||||
go10sForward: () => win.webContents.send('ytmd:seek-by', 10),
|
||||
go1sBack: () => win.webContents.send('ytmd:seek-by', -1),
|
||||
go1sForward: () => win.webContents.send('ytmd:seek-by', 1),
|
||||
shuffle: () => win.webContents.send('ytmd:shuffle'),
|
||||
switchRepeat: (n = 1) => win.webContents.send('ytmd:switch-repeat', n),
|
||||
// General
|
||||
volumeMinus10: () => {
|
||||
ipcMain.once('ytmd:get-volume-return', (_, volume) => {
|
||||
win.webContents.send('ytmd:update-volume', volume - 10);
|
||||
});
|
||||
win.webContents.send('ytmd:get-volume');
|
||||
},
|
||||
volumePlus10: () => {
|
||||
ipcMain.once('ytmd:get-volume-return', (_, volume) => {
|
||||
win.webContents.send('ytmd:update-volume', volume + 10);
|
||||
});
|
||||
win.webContents.send('ytmd:get-volume');
|
||||
},
|
||||
fullscreen: () => win.webContents.send('ytmd:toggle-fullscreen'),
|
||||
muteUnmute: () => win.webContents.send('ytmd:toggle-mute'),
|
||||
search: () => win.webContents.sendInputEvent({
|
||||
type: 'keyDown',
|
||||
keyCode: '/',
|
||||
}),
|
||||
};
|
||||
return {
|
||||
...commands,
|
||||
|
||||
@ -7,7 +7,7 @@ import config from '@/config';
|
||||
|
||||
import type { GetPlayerResponse } from '@/types/get-player-response';
|
||||
|
||||
enum MediaType {
|
||||
export enum MediaType {
|
||||
/**
|
||||
* Audio uploaded by the original artist
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user