mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +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:
@ -22,7 +22,7 @@ import getSongControls from '@/providers/song-controls';
|
||||
import config from '@/config';
|
||||
import { LoggerPrefix } from '@/utils';
|
||||
|
||||
import type { RepeatMode } from '@/types/datahost-get-state';
|
||||
import type { RepeatMode, VolumeState } from '@/types/datahost-get-state';
|
||||
import type { QueueResponse } from '@/types/youtube-music-desktop-internal';
|
||||
|
||||
class YTPlayer extends MprisPlayer {
|
||||
@ -305,8 +305,10 @@ function registerMPRIS(win: BrowserWindow) {
|
||||
console.trace(error);
|
||||
});
|
||||
|
||||
ipcMain.on('ytmd:volume-changed', (_, newVol) => {
|
||||
player.volume = Number.parseFloat((newVol / 100).toFixed(2));
|
||||
ipcMain.on('ytmd:volume-changed', (_, newVolumeState: VolumeState) => {
|
||||
player.volume = newVolumeState.isMuted
|
||||
? 0
|
||||
: Number.parseFloat((newVolumeState.state / 100).toFixed(2));
|
||||
});
|
||||
|
||||
player.on('volume', async (newVolume: number) => {
|
||||
|
||||
Reference in New Issue
Block a user