From 1353fa5a949bffbe8cf662d7b017748ffafca093 Mon Sep 17 00:00:00 2001 From: GooseOb Date: Sat, 25 May 2024 22:10:16 +0200 Subject: [PATCH] remove `Ctrl+Shift+Space` quality setting shortcut --- index.ts | 22 +++++++--------------- package.json | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/index.ts b/index.ts index 4328d30..eb1a9f4 100644 --- a/index.ts +++ b/index.ts @@ -783,7 +783,7 @@ document.addEventListener( 'keyup', (e) => { if (e.code === 'Enter') return onClick(e); - if (!e.ctrlKey) return; + if (!e.ctrlKey || e.shiftKey) return; if (cfg.flags.copySubs && e.code === 'KeyC') { const plr = document.querySelector('.html5-video-player'); if (!plr?.classList.contains('ytp-fullscreen')) return; @@ -797,21 +797,13 @@ document.addEventListener( if (e.code !== 'Space') return; e.stopPropagation(); e.preventDefault(); - let setting: YTSetting; - if (e.shiftKey) { - setting = QUALITY; - } else { - const value = channelConfig.current - ? channelConfig.current.customSpeed || - (!channelConfig.current.speed && cfg.global.customSpeed) - : cfg.global.customSpeed; - if (value) return valueSetters.customSpeed(value); - setting = SPEED; - } + const customSpeedValue = channelConfig.current + ? channelConfig.current.customSpeed || + (!channelConfig.current.speed && cfg.global.customSpeed) + : cfg.global.customSpeed; + if (customSpeedValue) return valueSetters.customSpeed(customSpeedValue); restoreFocusAfter(() => { - valueSetters[setting]( - (channelConfig.current || cfg.global)[setting] as never - ); + valueSetters[SPEED]((channelConfig.current || cfg.global)[SPEED]); }); }, { capture: true } diff --git a/package.json b/package.json index 632f42e..cfcf956 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "yt-defaulter", "author": "GooseOb", - "version": "1.9.4", + "version": "1.10.0", "repository": { "type": "git", "url": "git+https://github.com/GooseOb/YT-Defaulter.git"