File tree 1 file changed +2
-19
lines changed
1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -305,31 +305,14 @@ function registerMPRIS(win: BrowserWindow) {
305
305
console . trace ( error ) ;
306
306
} ) ;
307
307
308
- let mprisVolNewer = false ;
309
- let autoUpdate = false ;
310
308
ipcMain . on ( 'ytmd:volume-changed' , ( _ , newVol ) => {
311
- if ( ~ ~ ( player . volume * 100 ) !== newVol ) {
312
- if ( mprisVolNewer ) {
313
- mprisVolNewer = false ;
314
- autoUpdate = false ;
315
- } else {
316
- autoUpdate = true ;
317
- player . volume = Number . parseFloat ( ( newVol / 100 ) . toFixed ( 2 ) ) ;
318
- mprisVolNewer = false ;
319
- autoUpdate = false ;
320
- }
321
- }
309
+ player . volume = Number . parseFloat ( ( newVol / 100 ) . toFixed ( 2 ) ) ;
322
310
} ) ;
323
311
324
312
player . on ( 'volume' , ( newVolume : number ) => {
325
313
if ( config . plugins . isEnabled ( 'precise-volume' ) ) {
326
314
// With precise volume we can set the volume to the exact value.
327
- const newVol = ~ ~ ( newVolume * 100 ) ;
328
- if ( ~ ~ ( player . volume * 100 ) !== newVol && ! autoUpdate ) {
329
- mprisVolNewer = true ;
330
- autoUpdate = false ;
331
- win . webContents . send ( 'setVolume' , newVol ) ;
332
- }
315
+ win . webContents . send ( 'setVolume' , ~ ~ ( newVolume * 100 ) ) ;
333
316
} else {
334
317
setVolume ( newVolume * 100 ) ;
335
318
}
You can’t perform that action at this time.
0 commit comments