diff --git a/backlog/tasks/task-270 - Make-Windows-mpv-shortcut-self-contained.md b/backlog/tasks/task-270 - Make-Windows-mpv-shortcut-self-contained.md new file mode 100644 index 00000000..44f2098e --- /dev/null +++ b/backlog/tasks/task-270 - Make-Windows-mpv-shortcut-self-contained.md @@ -0,0 +1,30 @@ +--- +id: TASK-270 +title: Make Windows mpv shortcut self-contained +status: Done +assignee: [] +created_date: '2026-04-02 07:13' +updated_date: '2026-04-02 07:19' +labels: [] +dependencies: [] +priority: medium +--- + +## Description + + +Remove the Windows mpv shortcut's dependency on a pre-existing mpv profile so the installer-created `SubMiner mpv` flow works out of the box without requiring the user to edit `mpv.conf`. Keep docs aligned with the new behavior and preserve the optional profile guidance for manual mpv usage. + + +## Acceptance Criteria + +- [x] #1 `SubMiner.exe --launch-mpv` launches mpv with SubMiner's required default args without requiring an mpv profile named `subminer`. +- [x] #2 Windows shortcut/help/docs no longer describe `--launch-mpv` as depending on the SubMiner mpv profile. +- [x] #3 Automated tests cover the Windows launch args behavior and pass after the change. + + +## Final Summary + + +Updated the Windows `--launch-mpv` path to pass SubMiner's default mpv args directly instead of requiring `--profile=subminer`. Adjusted Windows shortcut/help text to describe the self-contained defaults-based launch, and updated Windows docs to state that `mpv.conf` is not required for the shortcut path while preserving the optional profile guidance for manual mpv launches. + diff --git a/changes/268-windows-mpv-shortcut-defaults.md b/changes/268-windows-mpv-shortcut-defaults.md new file mode 100644 index 00000000..18e41f2a --- /dev/null +++ b/changes/268-windows-mpv-shortcut-defaults.md @@ -0,0 +1,5 @@ +type: fixed +area: launcher + +- Fixed the Windows `SubMiner mpv` shortcut and `SubMiner.exe --launch-mpv` flow to launch mpv with SubMiner's required default args directly instead of requiring an `mpv.conf` profile named `subminer`. +- Clarified the Windows install and usage docs so the shortcut path is documented as self-contained, while the optional `subminer` mpv profile remains available for manual mpv launches. diff --git a/docs-site/installation.md b/docs-site/installation.md index bac4bcb5..0c46d414 100644 --- a/docs-site/installation.md +++ b/docs-site/installation.md @@ -172,6 +172,7 @@ Install `mpv` separately and ensure `mpv.exe` is on `PATH`. `ffmpeg` is still re ### Windows Usage Notes - Launch `SubMiner.exe` once to let the first-run setup flow seed `%APPDATA%\\SubMiner\\config.jsonc`, offer mpv plugin installation, open bundled Yomitan settings, and optionally create `SubMiner mpv` Start Menu/Desktop shortcuts. +- `SubMiner.exe --launch-mpv` and the optional `SubMiner mpv` shortcut pass SubMiner's default mpv socket/subtitle args directly; they do not require an `mpv.conf` profile named `subminer`. - First-run mpv plugin installs pin `binary_path` to the current `SubMiner.exe` automatically. Manual plugin configs can leave `binary_path` empty unless SubMiner is installed in a non-standard location. - Windows plugin installs rewrite `socket_path` to `\\.\pipe\subminer-socket`; do not keep `/tmp/subminer-socket` on Windows. - Native window tracking is built in on Windows; no `xdotool`, `xwininfo`, or compositor-specific helper is required. diff --git a/docs-site/usage.md b/docs-site/usage.md index bbc67773..397b03d4 100644 --- a/docs-site/usage.md +++ b/docs-site/usage.md @@ -117,12 +117,12 @@ SubMiner.AppImage --help # Show all options ### Windows mpv Shortcut -If you enabled the optional Windows shortcut during install, SubMiner creates a `SubMiner mpv` shortcut in the Start menu and/or on the desktop. It runs `SubMiner.exe --launch-mpv`, which starts `mpv.exe` with SubMiner's `subminer` profile. +If you enabled the optional Windows shortcut during install, SubMiner creates a `SubMiner mpv` shortcut in the Start menu and/or on the desktop. It runs `SubMiner.exe --launch-mpv`, which starts `mpv.exe` with SubMiner's default launch args directly. You can use it three ways: -- Double-click `SubMiner mpv` to open `mpv` with the SubMiner profile. -- Drag a video file onto `SubMiner mpv` to launch that file with the same profile. +- Double-click `SubMiner mpv` to open `mpv` with SubMiner's default socket/subtitle args. +- Drag a video file onto `SubMiner mpv` to launch that file with the same defaults. - Run it directly from Command Prompt or PowerShell with `--launch-mpv`. ```powershell @@ -130,7 +130,7 @@ You can use it three ways: & "C:\Program Files\SubMiner\SubMiner.exe" --launch-mpv "C:\Videos\episode 01.mkv" ``` -This flow requires `mpv.exe` to be on `PATH`. If it is installed elsewhere, set `SUBMINER_MPV_PATH` to the full `mpv.exe` path before launching. +This flow requires `mpv.exe` to be on `PATH`. If it is installed elsewhere, set `SUBMINER_MPV_PATH` to the full `mpv.exe` path before launching. On Windows, `--launch-mpv` does not require an `mpv.conf` profile named `subminer`. ### Launcher Subcommands @@ -189,7 +189,7 @@ Top-level launcher flags like `--jellyfin-*` are intentionally rejected. You can append additional MPV arguments with launcher `-a/--args`, for example `--args "--ao=alsa --volume=80"`. -You can define a matching profile in `~/.config/mpv/mpv.conf` for consistency when launching `mpv` manually or from other tools. `subminer` launches with `--profile=subminer` by default (or override with `subminer -p ...`): +You can define a matching profile in `~/.config/mpv/mpv.conf` for consistency when launching `mpv` manually or from other tools. The Windows `SubMiner.exe --launch-mpv` shortcut path uses equivalent args directly; the optional profile remains useful for manual mpv launches and the `subminer` wrapper defaults to `--profile=subminer` (or override with `subminer -p ...`): ```ini [subminer] diff --git a/src/cli/help.test.ts b/src/cli/help.test.ts index f253da57..3601c626 100644 --- a/src/cli/help.test.ts +++ b/src/cli/help.test.ts @@ -17,7 +17,7 @@ test('printHelp includes configured texthooker port', () => { assert.match(output, /--help\s+Show this help/); assert.match(output, /default: 7777/); - assert.match(output, /--launch-mpv/); + assert.match(output, /--launch-mpv.*Launch mpv with SubMiner defaults and exit/); assert.match(output, /--stats\s+Open the stats dashboard in your browser/); assert.doesNotMatch(output, /--refresh-known-words/); assert.match(output, /--setup\s+Open first-run setup window/); diff --git a/src/cli/help.ts b/src/cli/help.ts index 3cb97311..7b74700b 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -12,7 +12,7 @@ ${B}Usage:${R} subminer ${D}[command] [options]${R} ${B}Session${R} --background Start in tray/background mode --start Connect to mpv and launch overlay - --launch-mpv ${D}[targets...]${R} Launch mpv with the SubMiner mpv profile and exit + --launch-mpv ${D}[targets...]${R} Launch mpv with SubMiner defaults and exit --stop Stop the running instance --stats Open the stats dashboard in your browser --texthooker Start texthooker server only ${D}(no overlay)${R} diff --git a/src/main/runtime/windows-mpv-launch.test.ts b/src/main/runtime/windows-mpv-launch.test.ts index e45c8065..83bdb9b8 100644 --- a/src/main/runtime/windows-mpv-launch.test.ts +++ b/src/main/runtime/windows-mpv-launch.test.ts @@ -40,10 +40,17 @@ test('resolveWindowsMpvPath falls back to where.exe output', () => { assert.equal(resolved, 'C:\\tools\\mpv.exe'); }); -test('buildWindowsMpvLaunchArgs keeps pseudo-gui profile and targets', () => { +test('buildWindowsMpvLaunchArgs uses explicit SubMiner defaults and targets', () => { assert.deepEqual(buildWindowsMpvLaunchArgs(['C:\\a.mkv', 'C:\\b.mkv']), [ '--player-operation-mode=pseudo-gui', - '--profile=subminer', + '--input-ipc-server=\\\\.\\pipe\\subminer-socket', + '--alang=ja,jp,jpn,japanese,en,eng,english,enus,en-us', + '--slang=ja,jp,jpn,japanese,en,eng,english,enus,en-us', + '--sub-auto=fuzzy', + '--sub-file-paths=.;subs;subtitles', + '--sid=auto', + '--secondary-sid=auto', + '--secondary-sub-visibility=no', 'C:\\a.mkv', 'C:\\b.mkv', ]); @@ -81,7 +88,7 @@ test('launchWindowsMpv spawns detached mpv with targets', () => { assert.equal(result.mpvPath, 'C:\\mpv\\mpv.exe'); assert.deepEqual(calls, [ 'C:\\mpv\\mpv.exe', - '--player-operation-mode=pseudo-gui|--profile=subminer|C:\\video.mkv', + '--player-operation-mode=pseudo-gui|--input-ipc-server=\\\\.\\pipe\\subminer-socket|--alang=ja,jp,jpn,japanese,en,eng,english,enus,en-us|--slang=ja,jp,jpn,japanese,en,eng,english,enus,en-us|--sub-auto=fuzzy|--sub-file-paths=.;subs;subtitles|--sid=auto|--secondary-sid=auto|--secondary-sub-visibility=no|C:\\video.mkv', ]); }); diff --git a/src/main/runtime/windows-mpv-launch.ts b/src/main/runtime/windows-mpv-launch.ts index 4424f2f3..e67da769 100644 --- a/src/main/runtime/windows-mpv-launch.ts +++ b/src/main/runtime/windows-mpv-launch.ts @@ -34,7 +34,19 @@ export function resolveWindowsMpvPath(deps: WindowsMpvLaunchDeps): string { } export function buildWindowsMpvLaunchArgs(targets: string[], extraArgs: string[] = []): string[] { - return ['--player-operation-mode=pseudo-gui', '--profile=subminer', ...extraArgs, ...targets]; + return [ + '--player-operation-mode=pseudo-gui', + '--input-ipc-server=\\\\.\\pipe\\subminer-socket', + '--alang=ja,jp,jpn,japanese,en,eng,english,enus,en-us', + '--slang=ja,jp,jpn,japanese,en,eng,english,enus,en-us', + '--sub-auto=fuzzy', + '--sub-file-paths=.;subs;subtitles', + '--sid=auto', + '--secondary-sid=auto', + '--secondary-sub-visibility=no', + ...extraArgs, + ...targets, + ]; } export function launchWindowsMpv( diff --git a/src/main/runtime/windows-mpv-shortcuts.test.ts b/src/main/runtime/windows-mpv-shortcuts.test.ts index a0c864f6..4f5d1686 100644 --- a/src/main/runtime/windows-mpv-shortcuts.test.ts +++ b/src/main/runtime/windows-mpv-shortcuts.test.ts @@ -33,7 +33,7 @@ test('buildWindowsMpvShortcutDetails targets SubMiner.exe with --launch-mpv', () target: 'C:\\Apps\\SubMiner\\SubMiner.exe', args: '--launch-mpv', cwd: 'C:\\Apps\\SubMiner', - description: 'Launch mpv with the SubMiner profile', + description: 'Launch mpv with SubMiner defaults', icon: 'C:\\Apps\\SubMiner\\SubMiner.exe', iconIndex: 0, }); diff --git a/src/main/runtime/windows-mpv-shortcuts.ts b/src/main/runtime/windows-mpv-shortcuts.ts index 013885c7..403670fd 100644 --- a/src/main/runtime/windows-mpv-shortcuts.ts +++ b/src/main/runtime/windows-mpv-shortcuts.ts @@ -55,7 +55,7 @@ export function buildWindowsMpvShortcutDetails(exePath: string): WindowsShortcut target: exePath, args: '--launch-mpv', cwd: path.win32.dirname(exePath), - description: 'Launch mpv with the SubMiner profile', + description: 'Launch mpv with SubMiner defaults', icon: exePath, iconIndex: 0, };