mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 12:21:47 +00:00
chore: improve readability
This commit is contained in:
@ -29,7 +29,7 @@ import type { SongInfo } from '@/providers/song-info';
|
||||
import type { BackendContext } from '@/types/contexts';
|
||||
import type { APIServerConfig } from '../../config';
|
||||
import type { HonoApp } from '../types';
|
||||
import type { QueueResponse } from '@/types/youtube-music-desktop-internal';
|
||||
import type { QueueResponse } from '@/types/music-player-desktop-internal';
|
||||
import type { Context } from 'hono';
|
||||
|
||||
const routes = {
|
||||
@ -630,7 +630,7 @@ export const register = (
|
||||
app.openapi(routes.getShuffleState, async (ctx) => {
|
||||
const stateResponsePromise = new Promise<boolean>((resolve) => {
|
||||
ipcMain.once(
|
||||
'ytmd:get-shuffle-response',
|
||||
'peard:get-shuffle-response',
|
||||
(_, isShuffled: boolean | undefined) => {
|
||||
return resolve(!!isShuffled);
|
||||
},
|
||||
@ -693,7 +693,7 @@ export const register = (
|
||||
app.openapi(routes.getFullscreenState, async (ctx) => {
|
||||
const stateResponsePromise = new Promise<boolean>((resolve) => {
|
||||
ipcMain.once(
|
||||
'ytmd:set-fullscreen',
|
||||
'peard:set-fullscreen',
|
||||
(_, isFullscreen: boolean | undefined) => {
|
||||
return resolve(!!isFullscreen);
|
||||
},
|
||||
@ -728,7 +728,7 @@ export const register = (
|
||||
// Queue
|
||||
const queueInfo = async (ctx: Context) => {
|
||||
const queueResponsePromise = new Promise<QueueResponse>((resolve) => {
|
||||
ipcMain.once('ytmd:get-queue-response', (_, queue: QueueResponse) => {
|
||||
ipcMain.once('peard:get-queue-response', (_, queue: QueueResponse) => {
|
||||
return resolve(queue);
|
||||
});
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ export const register = (
|
||||
lastSongInfo = { ...songInfo };
|
||||
});
|
||||
|
||||
ipc.on('ytmd:volume-changed', (newVolumeState: VolumeState) => {
|
||||
ipc.on('peard:volume-changed', (newVolumeState: VolumeState) => {
|
||||
volumeState = newVolumeState;
|
||||
send(DataTypes.VolumeChanged, {
|
||||
volume: volumeState.state,
|
||||
@ -102,16 +102,16 @@ export const register = (
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on('ytmd:repeat-changed', (mode: RepeatMode) => {
|
||||
ipc.on('peard:repeat-changed', (mode: RepeatMode) => {
|
||||
repeat = mode;
|
||||
send(DataTypes.RepeatChanged, { repeat });
|
||||
});
|
||||
|
||||
ipc.on('ytmd:seeked', (t: number) => {
|
||||
ipc.on('peard:seeked', (t: number) => {
|
||||
send(DataTypes.PositionChanged, { position: t });
|
||||
});
|
||||
|
||||
ipc.on('ytmd:shuffle-changed', (newShuffle: boolean) => {
|
||||
ipc.on('peard:shuffle-changed', (newShuffle: boolean) => {
|
||||
shuffle = newShuffle;
|
||||
send(DataTypes.ShuffleChanged, { shuffle });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user