Ver Fonte

feat: frameSkipAmount advanced cfg option

Sv443 há 3 dias atrás
pai
commit
b3cbc48c5f

+ 9 - 9
assets/translations/README.md

@@ -16,15 +16,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 ### Translation progress:
 |   | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
-|  | [`en-US`](./en-US.json) | `346` (default locale) |  |
-| ✅ | [`de-DE`](./de-DE.json) | `346/346` (100%) | ─ |
-|  | [`en-GB`](./en-GB.json) | `346/346` (100%) | `en-US` |
-| ⚠ | [`es-ES`](./es-ES.json) | `337/346` (97.4%) | ─ |
-| ⚠ | [`fr-FR`](./fr-FR.json) | `337/346` (97.4%) | ─ |
-| ⚠ | [`hi-IN`](./hi-IN.json) | `337/346` (97.4%) | ─ |
-| ⚠ | [`ja-JP`](./ja-JP.json) | `337/346` (97.4%) | ─ |
-| ⚠ | [`pt-BR`](./pt-BR.json) | `337/346` (97.4%) | ─ |
-| ⚠ | [`zh-CN`](./zh-CN.json) | `337/346` (97.4%) | ─ |
+|  | [`en-US`](./en-US.json) | `348` (default locale) |  |
+| ✅ | [`de-DE`](./de-DE.json) | `348/348` (100%) | ─ |
+|  | [`en-GB`](./en-GB.json) | `348/348` (100%) | `en-US` |
+| ⚠ | [`es-ES`](./es-ES.json) | `339/348` (97.4%) | ─ |
+| ⚠ | [`fr-FR`](./fr-FR.json) | `339/348` (97.4%) | ─ |
+| ⚠ | [`hi-IN`](./hi-IN.json) | `339/348` (97.4%) | ─ |
+| ⚠ | [`ja-JP`](./ja-JP.json) | `339/348` (97.4%) | ─ |
+| ⚠ | [`pt-BR`](./pt-BR.json) | `339/348` (97.4%) | ─ |
+| ⚠ | [`zh-CN`](./zh-CN.json) | `339/348` (97.4%) | ─ |
 
 <sub>
 ✅ - Fully translated

+ 3 - 1
assets/translations/de-DE.json

@@ -80,7 +80,7 @@
   "volume_shared_tooltip": "Lautstärke wird zwischen allen Tabs geteilt - deaktivieren in den Einstellungen",
   "middle_click_open_tab": "Mittel-Klick um in einem neuen Tab zu öffnen",
   "example_toast": "Beispiel-Toast",
-  "generic_error_toast_encountered_error_type": "%1 ist aufgetreten",
+  "generic_error_toast_encountered_error_type": "Ein %1 ist aufgetreten",
   "generic_error_toast_click_for_details": "Klicke für Details",
   "error": "Error",
   "generic_error_dialog_message": "Ein Error ist aufgetreten.",
@@ -318,6 +318,8 @@
   "feature_desc_arrowKeySkipBy": "Um wie viele Sekunden vor- und zurückspulen, wenn die Pfeiltasten benutzt werden",
   "feature_desc_frameSkip": "Mit den Tasten \"Punkt\" und \"Komma\" um einen Frame spulen, während der Song oder das Video pausiert ist",
   "feature_desc_frameSkipWhilePlaying": "Erlaube das Spulen um einen Frame auch während der Song oder das Video noch läuft",
+  "feature_desc_frameSkipAmount": "Wie viele Sekunden mit den Tasten \"Punkt\" und \"Komma\" übersprungen werden sollen",
+  "feature_helptext_frameSkipAmount": "Dieses Feature ist auch auf YT verfügbar und überspringt einen festen Wert von etwa 0.0417 Sekunden. Wenn nötig, kannst du hier einen anderen Wert festlegen.",
   "feature_desc_switchBetweenSites": "Füge einen Hotkey hinzu, um zwischen den YT und YTM Seiten zu wechseln",
   "feature_helptext_switchBetweenSites": "Wenn du auf YouTube oder YouTube Music bist, kannst du mit diesem Hotkey zur anderen Seite wechseln, während du auf demselben Video / Song bleibst.",
   "feature_desc_switchSitesHotkey": "Welcher Hotkey muss gedrückt werden, um zwischen den Seiten zu wechseln?",

+ 2 - 0
assets/translations/en-US.json

@@ -318,6 +318,8 @@
   "feature_desc_arrowKeySkipBy": "By how many seconds to skip when using the arrow keys",
   "feature_desc_frameSkip": "Use the period and comma keys to skip forwards and backwards by a frame when the video or song is paused",
   "feature_desc_frameSkipWhilePlaying": "Also allow skipping by a frame while the video or song is still playing",
+  "feature_desc_frameSkipAmount": "How many seconds to skip with the period and comma keys",
+  "feature_helptext_frameSkipAmount": "This same feature which is natively available on YT skips by a fixed value of about 0.0417 seconds. If needed, adjust it to a different value here.",
   "feature_desc_switchBetweenSites": "Add a hotkey to switch between the YT and YTM sites on a video or song",
   "feature_helptext_switchBetweenSites": "Pressing this hotkey will switch to the other site if you are on YouTube or YouTube Music while staying on the same video or song.",
   "feature_desc_switchSitesHotkey": "Which hotkey needs to be pressed to switch sites?",

+ 2 - 0
assets/translations/es-ES.json

@@ -308,6 +308,8 @@
   "feature_desc_arrowKeySkipBy": "Por cuántos segundos saltar al usar las teclas de flecha",
   "feature_desc_frameSkip": "Utilice las teclas de punto y coma para avanzar o retroceder un cuadro cuando el video o la canción estén en pausa.",
   "feature_desc_frameSkipWhilePlaying": "Utilice las teclas de punto y coma para avanzar o retroceder un cuadro mientras el video o la canción se están reproduciendo.",
+  "feature_desc_frameSkipAmount": "Cuántos segundos saltar al usar las teclas de punto y coma",
+  "feature_helptext_frameSkipAmount": "Este ajuste también está disponible en YT y salta un valor fijo de aproximadamente 0.0417 segundos. Si es necesario, puede establecer otro valor aquí.",
   "feature_desc_switchBetweenSites": "Agregue una tecla de acceso rápido para cambiar entre los sitios YT y YTM en una canción",
   "feature_helptext_switchBetweenSites": "Al presionar esta tecla de acceso rápido, cambiará al otro sitio si está en YouTube o YouTube Music mientras se mantiene en el mismo video / canción.",
   "feature_desc_switchSitesHotkey": "¿Qué tecla de acceso rápido debe presionarse para cambiar de sitio?",

+ 2 - 0
assets/translations/fr-FR.json

@@ -308,6 +308,8 @@
   "feature_desc_arrowKeySkipBy": "De combien de secondes sauter en utilisant les touches fléchées",
   "feature_desc_frameSkip": "Utiliser les touches virgule et point pour avancer et reculer d'une image lorsque la vidéo ou la chanson est en pause",
   "feature_desc_frameSkipWhilePlaying": "Utiliser les touches virgule et point pour avancer et reculer d'une image lorsque la vidéo ou la chanson est en cours de lecture",
+  "feature_desc_frameSkipAmount": "De combien de secondes sauter avec les touches \"point\" et \"virgule\"",
+  "feature_helptext_frameSkipAmount": "Cette fonctionnalité est également disponible sur YT et saute une valeur fixe d'environ 0,0417 secondes. Si nécessaire, vous pouvez définir une autre valeur ici.",
   "feature_desc_switchBetweenSites": "Ajouter un raccourci pour passer d'un site à l'autre sur une vidéo / chanson",
   "feature_helptext_switchBetweenSites": "En appuyant sur ce raccourci, vous passerez à l'autre site si vous êtes sur YouTube ou YouTube Music tout en restant sur la même vidéo / chanson.",
   "feature_desc_switchSitesHotkey": "Quelle touche de raccourci doit être enfoncée pour passer d'un site à l'autre?",

+ 2 - 0
assets/translations/hi-IN.json

@@ -308,6 +308,8 @@
   "feature_desc_arrowKeySkipBy": "एरो कुंजियों का उपयोग करते समय कितने सेकंड छोड़ें",
   "feature_desc_frameSkip": "वीडियो या गीत को रोकने पर एक फ्रेम छोड़ें",
   "feature_desc_frameSkipWhilePlaying": "वीडियो या गीत को रोकने पर एक फ्रेम छोड़ें",
+  "feature_desc_frameSkipAmount": "\"पीरियड\" और \"कॉमा\" कुंजियों से कितने सेकंड छोड़े जाने चाहिए",
+  "feature_helptext_frameSkipAmount": "इस सुविधा को YT पर भी उपलब्ध है और यह लगभग 0.0417 सेकंड का एक निश्चित मान छोड़ता है। यदि आवश्यक हो, तो आप यहां एक अलग मान सेट कर सकते हैं।",
   "feature_desc_switchBetweenSites": "वीडियो / गीत पर YT और YTM साइटों के बीच स्विच करने के लिए एक हॉटकी जोड़ें",
   "feature_helptext_switchBetweenSites": "इस हॉटकी को दबाने से आप वर्तमान में चल रहे वीडियो / गीत के बीच स्विच कर सकते हैं जब आप YT या YTM पर होते हैं।",
   "feature_desc_switchSitesHotkey": "साइटों को स्विच करने के लिए कौन सी हॉटकी दबानी चाहिए?",

+ 2 - 0
assets/translations/ja-JP.json

@@ -308,6 +308,8 @@
   "feature_desc_arrowKeySkipBy": "矢印キーを使用してスキップする秒数",
   "feature_desc_frameSkip": "ビデオ / 曲を一時停止しているときに、フレーム単位で前後にスキップする",
   "feature_desc_frameSkipWhilePlaying": "ビデオ / 曲を再生しているときに、フレーム単位で前後にスキップする",
+  "feature_desc_frameSkipAmount": "\"ピリオド\"と\"カンマ\"キーで何秒スキップするか",
+  "feature_helptext_frameSkipAmount": "この機能は YT でも利用可能で、約 0.0417 秒の固定値をスキップします。必要に応じて、ここで別の値を設定できます。",
   "feature_desc_switchBetweenSites": "ビデオ / 曲の YT と YTM サイトを切り替えるホットキーを追加する",
   "feature_helptext_switchBetweenSites": "このホットキーを押すと、同じビデオ / 曲のままで YouTube または YouTube Music のどちらかに切り替わります。",
   "feature_desc_switchSitesHotkey": "サイトを切り替えるために押す必要があるホットキーはどれですか?",

+ 2 - 0
assets/translations/pt-BR.json

@@ -308,6 +308,8 @@
   "feature_desc_arrowKeySkipBy": "Por quantos segundos pular ao usar as teclas de seta",
   "feature_desc_frameSkip": "Use as teclas de ponto e vírgula para pular para frente e para trás por um quadro quando o vídeo ou música estiver pausado",
   "feature_desc_frameSkipWhilePlaying": "Use as teclas de ponto e vírgula para pular para frente e para trás por um quadro quando o vídeo ou música estiver tocando",
+  "feature_desc_frameSkipAmount": "Quantos segundos devem ser pulados com as teclas \"ponto\" e \"vírgula\"",
+  "feature_helptext_frameSkipAmount": "Este recurso também está disponível no YT e pula um valor fixo de cerca de 0,0417 segundos. Se necessário, você pode definir outro valor aqui.",
   "feature_desc_switchBetweenSites": "Adicione um atalho para alternar entre os sites YT e YTM em um vídeo / música",
   "feature_helptext_switchBetweenSites": "Pressionar este atalho alternará para o outro site se você estiver no YouTube ou YouTube Music, mantendo-se na mesma música / vídeo.",
   "feature_desc_switchSitesHotkey": "Qual tecla de atalho precisa ser pressionada para alternar entre os sites?",

+ 4 - 4
assets/translations/zh-CN.json

@@ -306,10 +306,10 @@
   "feature_desc_arrowKeySupport": "使用箭头键在当前播放的歌曲中前进和后退",
   "feature_helptext_arrowKeySupport": "通常,您只能使用 \"H\" 和 \"L\" 键以固定的 10 秒间隔前进和后退。此功能允许您也使用箭头键。\n要更改要跳过的秒数,请使用下面的选项。",
   "feature_desc_arrowKeySkipBy": "使用箭头键跳过多少秒",
-  "feature_desc_frameSkip": "",
-  "feature_desc_frameSkip": "Use the period and comma keys to skip forwards and backwards by a frame when the video or song is paused",
-  "feature_desc_frameSkipWhilePlaying": "",
-  "feature_desc_frameSkipWhilePlaying": "Also allow skipping by a frame while the video or song is still playing",
+  "feature_desc_frameSkip": "使用逗号和句号键在视频或歌曲暂停时前进和后退",
+  "feature_desc_frameSkipWhilePlaying": "使用逗号和句号键在视频或歌曲播放时前进和后退",
+  "feature_desc_frameSkipAmount": "在视频或歌曲暂停时使用逗号和句号键前进和后退",
+  "feature_helptext_frameSkipAmount": "该功能也可在 YT 上使用,并跳过约 0.0417 秒的固定值。如果需要,您可以在此处设置不同的值。",
   "feature_desc_switchBetweenSites": "在视频 / 歌曲上添加一个热键,以在 YT 和 YTM 网站之间切换",
   "feature_helptext_switchBetweenSites": "按下此热键将在 YT 或 YTM 上切换到另一个站点,同时保持在同一视频 / 歌曲上。",
   "feature_desc_switchSitesHotkey": "需要按下哪个热键才能切换网站?",

+ 1 - 1
src/config.ts

@@ -140,7 +140,7 @@ export const migrations: DataMigrationsDict = {
     useDefaultConfig(oldData, [
       "aboveQueueBtnsSticky", "autoScrollToActiveSongMode",
       "frameSkip", "frameSkipWhilePlaying",
-      "watchPageFullSize",
+      "frameSkipAmount", "watchPageFullSize",
     ]), [
       { key: "lyricsCacheMaxSize", oldDefault: 2000 },
     ],

+ 12 - 0
src/features/index.ts

@@ -529,6 +529,18 @@ export const featInfo = {
     advanced: true,
     textAdornment: adornments.advanced,
   },
+  frameSkipAmount: {
+    type: "number",
+    category: "input",
+    min: 0,
+    max: 1,
+    step: 0.0001,
+    default: 0.0417,
+    reloadRequired: false,
+    enable: noop,
+    advanced: true,
+    textAdornment: adornments.advanced,
+  },
   switchBetweenSites: {
     type: "toggle",
     category: "input",

+ 1 - 1
src/features/input.ts

@@ -73,7 +73,7 @@ export async function initFrameSkip() {
     evt.preventDefault();
     evt.stopImmediatePropagation();
 
-    const newTime = vid.currentTime + 0.04167 * (evt.code === "Comma" ? -1 : 1);
+    const newTime = vid.currentTime + getFeature("frameSkipAmount") * (evt.code === "Comma" ? -1 : 1);
     vid.currentTime = clamp(newTime, 0, vid.duration);
 
     log(`Captured key '${evt.code}' and skipped to ${Math.floor(newTime / 60)}m ${(newTime % 60).toFixed(1)}s (${Math.floor(newTime * 1000 % 1000)}ms)`);

+ 2 - 0
src/types.ts

@@ -596,6 +596,8 @@ export interface FeatureConfig {
   frameSkip: boolean;
   /** Allow frame skipping while the song is playing */
   frameSkipWhilePlaying: boolean;
+  /** Amount of seconds to skip when pressing the . and , keys */
+  frameSkipAmount: number;
   /** Add a hotkey to switch between the YT and YTM sites on a video / song */
   switchBetweenSites: boolean;
   /** The hotkey that needs to be pressed to initiate the site switch */