Skip to content

feat(hotkeys): add subtitle delay increase/decrease shortcuts - #2824

Open
Rukko wants to merge 2 commits into
edde746:mainfrom
Rukko:feat/subtitle-delay-shortcuts
Open

Rukko wants to merge 2 commits into
edde746:mainfrom
Rukko:feat/subtitle-delay-shortcuts

Conversation

@Rukko

@Rukko Rukko commented Oct 24, 2026

Copy link
Copy Markdown

Summary

Adds two configurable video player shortcuts to adjust the subtitle sync offset (sub-delay) without opening the settings sheet:

Action Default key Effect
Delay Subtitles X +50ms
Advance Subtitles Z -50ms

The defaults match mpv's own bindings, and both keys were unbound in Plezy. Both shortcuts can be reassigned in the keyboard shortcuts settings like any other action.

Behaviour

  • Each press steps the offset by 50ms, the same step as the subtitle sync slider. Holding the key repeats the step (repeatable: true), and the offset is clamped to the existing ScopedPlayerPrefs sync offset limits.
  • The applied offset is recorded in PlayerSyncOffsets, so the subtitle sync bar and the settings sheet show the new value.
  • The offset is persisted through ScopedPlayerPrefs.write under the configured sync offset scope, the same way the speed shortcuts persist through onSpeedPersist.
  • A player toast announces the new offset (for example Subtitle Sync +150ms).

The actions are appended after subSeekPrev so they sit next to the other subtitle shortcuts in settings. No existing entry is renamed or reordered.

Translations

The two labels are translated in every locale, using each locale's existing wording for subtitles and the style of the neighbouring shortcut labels.

Testing

  • Added tests in test/services/keyboard_shortcuts_service_test.dart covering stepping, key repeat, the reported offset and the clamp at the sync offset limit.
  • dart run scripts/checks/check_analyzer.dart, dart format, check-unused-code, scripts/checks/check_hardcoded_strings.py and scripts/checks/clean_translations.py --check --strict pass locally.
  • scripts/run_tests.sh passes except for 19 tests that fail identically on an unmodified checkout of main on Windows (mostly test/scripts/upload_symbols_test.dart).
  • Not yet exercised by hand in a running build.

AI assistance

This pull request was prepared with the assistance of Claude Opus 5.5.

@Rukko
Rukko marked this pull request as ready for review October 24, 2026 21:02
snapetech added a commit to snapetech-org/pleazyng that referenced this pull request Oct 25, 2026
Squash of upstream edde746/plezy PR edde746#2824 by Rukko, merged into PlezyNG
while it waits upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rukko
Rukko force-pushed the feat/subtitle-delay-shortcuts branch from 7d74784 to 2ad3047 Compare October 27, 2026 11:53
Add two configurable video player shortcuts that step mpv's sub-delay by
50ms, the same step as the subtitle sync slider. Defaults are X (delay)
and Z (advance), matching mpv. Holding the key repeats the step.

The applied offset is recorded in PlayerSyncOffsets so the settings sheet
reflects it, persisted under the configured sync offset scope, and
announced with a player toast.
@Rukko
Rukko force-pushed the feat/subtitle-delay-shortcuts branch from 2ad3047 to 75ac675 Compare November 10, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant