fix: stabilize local subtitle startup and pause release

This commit is contained in:
2026-04-03 01:12:31 -07:00
parent 8a5805550f
commit 61ab1b76fc
18 changed files with 515 additions and 48 deletions

View File

@@ -448,6 +448,8 @@ See `config.example.jsonc` for detailed configuration options.
| `autoLoadSecondarySub` | `true`, `false` | Auto-detect and load matching secondary subtitle track |
| `defaultMode` | `"hidden"`, `"visible"`, `"hover"` | Initial display mode (default: `"hover"`) |
`secondarySub.secondarySubLanguages` also acts as the fallback secondary-language priority for managed startup subtitle selection on local playback and YouTube playback.
**Display modes:**
- **hidden** — Secondary subtitles not shown
@@ -1342,7 +1344,7 @@ Usage notes:
### YouTube Playback Settings
Set defaults used by the `subminer` launcher for YouTube subtitle loading:
Set defaults used by managed subtitle auto-selection and the `subminer` launcher YouTube flow:
```json
{
@@ -1354,7 +1356,7 @@ Set defaults used by the `subminer` launcher for YouTube subtitle loading:
| Option | Values | Description |
| --------------------- | -------------------- | ---------------------------------------------------------------------------------------------- |
| `primarySubLanguages` | string[] | Primary subtitle language priority for YouTube auto-loading (default `["ja", "jpn"]`) |
| `primarySubLanguages` | string[] | Primary subtitle language priority for managed subtitle auto-selection (default `["ja", "jpn"]`) |
Current launcher behavior:
@@ -1370,6 +1372,7 @@ Language targets are derived from subtitle config:
- primary track: `youtube.primarySubLanguages` (falls back to `["ja","jpn"]`)
- secondary track: `secondarySub.secondarySubLanguages` (falls back to English when empty)
- Local playback uses the same priorities after mpv reports subtitle track metadata, so sidecar/internal mixed sets can override an incorrect initial `sid=auto` pick.
- Tracks are resolved and loaded before mpv starts; the older launcher mode switch has been removed.
Precedence for launcher defaults is: CLI flag > environment variable > `config.jsonc` > built-in default.

View File

@@ -187,7 +187,7 @@
// ==========================================
// Secondary Subtitles
// Dual subtitle track options.
// Used by the YouTube subtitle loading flow as secondary language preferences.
// Used by managed subtitle loading as secondary language preferences for local and YouTube playback.
// Hot-reload: defaultMode updates live while SubMiner is running.
// ==========================================
"secondarySub": {
@@ -415,14 +415,14 @@
// ==========================================
// YouTube Playback Settings
// Defaults for SubMiner YouTube subtitle loading and languages.
// Defaults for managed subtitle language preferences and YouTube subtitle loading.
// ==========================================
"youtube": {
"primarySubLanguages": [
"ja",
"jpn"
] // Comma-separated primary subtitle language priority for YouTube auto-loading.
}, // Defaults for SubMiner YouTube subtitle loading and languages.
] // Comma-separated primary subtitle language priority for managed subtitle auto-selection.
}, // Defaults for managed subtitle language preferences and YouTube subtitle loading.
// ==========================================
// Anilist

View File

@@ -213,10 +213,6 @@ secondary-sid=auto
secondary-sub-visibility=no
```
::: warning
`secondary-slang` is not a valid mpv option. Use `slang` with `sid=auto` / `secondary-sid=auto` to set subtitle language preferences.
:::
### Yomitan setup
SubMiner includes a bundled Yomitan extension for overlay word lookup. This bundled extension is separate from any Yomitan browser extension you may have installed.
@@ -241,6 +237,8 @@ Notes:
- Secondary target languages come from `secondarySub.secondarySubLanguages` (defaults to English if unset).
- Configure defaults in `$XDG_CONFIG_HOME/SubMiner/config.jsonc` (or `~/.config/SubMiner/config.jsonc`) under `youtube` and `secondarySub`.
For local video files, SubMiner now uses those same config-driven language priorities after mpv finishes reporting subtitle tracks. That means mixed internal/external subtitle sets can correct an initial `sid=auto` guess and settle onto the expected primary and secondary tracks without manual cycling.
## Controller Support
SubMiner supports gamepad/controller input for couch-friendly usage via the Chrome Gamepad API. Controller input drives the overlay while keyboard-only mode is enabled.
@@ -294,9 +292,7 @@ See [Keyboard Shortcuts](/shortcuts) for the full reference, including mining sh
| `Alt+Shift+O` | Toggle visible overlay |
| `Alt+Shift+Y` | Open Yomitan settings |
::: tip
`Alt+Shift+Y` is fixed and not configurable. All other shortcuts can be changed under `shortcuts` in your config.
:::
Useful overlay-local default keybinding: `Ctrl+Alt+P` opens the playlist browser for the current video's parent directory and the live mpv queue so you can append, reorder, remove, or jump between episodes without leaving playback.