mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-03 06:12:07 -07:00
fix: make Windows mpv shortcut self-contained
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||||
|
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.
|
||||||
|
<!-- SECTION:DESCRIPTION:END -->
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
<!-- AC:BEGIN -->
|
||||||
|
- [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.
|
||||||
|
<!-- AC:END -->
|
||||||
|
|
||||||
|
## Final Summary
|
||||||
|
|
||||||
|
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||||
|
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.
|
||||||
|
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||||
5
changes/268-windows-mpv-shortcut-defaults.md
Normal file
5
changes/268-windows-mpv-shortcut-defaults.md
Normal file
@@ -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.
|
||||||
@@ -172,6 +172,7 @@ Install `mpv` separately and ensure `mpv.exe` is on `PATH`. `ffmpeg` is still re
|
|||||||
### Windows Usage Notes
|
### 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.
|
- 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.
|
- 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.
|
- 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.
|
- Native window tracking is built in on Windows; no `xdotool`, `xwininfo`, or compositor-specific helper is required.
|
||||||
|
|||||||
@@ -117,12 +117,12 @@ SubMiner.AppImage --help # Show all options
|
|||||||
|
|
||||||
### Windows mpv Shortcut
|
### 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:
|
You can use it three ways:
|
||||||
|
|
||||||
- Double-click `SubMiner mpv` to open `mpv` with the SubMiner 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 profile.
|
- 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`.
|
- Run it directly from Command Prompt or PowerShell with `--launch-mpv`.
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
@@ -130,7 +130,7 @@ You can use it three ways:
|
|||||||
& "C:\Program Files\SubMiner\SubMiner.exe" --launch-mpv "C:\Videos\episode 01.mkv"
|
& "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
|
### 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 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 <profile> ...`):
|
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 <profile> ...`):
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[subminer]
|
[subminer]
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ test('printHelp includes configured texthooker port', () => {
|
|||||||
|
|
||||||
assert.match(output, /--help\s+Show this help/);
|
assert.match(output, /--help\s+Show this help/);
|
||||||
assert.match(output, /default: 7777/);
|
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.match(output, /--stats\s+Open the stats dashboard in your browser/);
|
||||||
assert.doesNotMatch(output, /--refresh-known-words/);
|
assert.doesNotMatch(output, /--refresh-known-words/);
|
||||||
assert.match(output, /--setup\s+Open first-run setup window/);
|
assert.match(output, /--setup\s+Open first-run setup window/);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ ${B}Usage:${R} subminer ${D}[command] [options]${R}
|
|||||||
${B}Session${R}
|
${B}Session${R}
|
||||||
--background Start in tray/background mode
|
--background Start in tray/background mode
|
||||||
--start Connect to mpv and launch overlay
|
--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
|
--stop Stop the running instance
|
||||||
--stats Open the stats dashboard in your browser
|
--stats Open the stats dashboard in your browser
|
||||||
--texthooker Start texthooker server only ${D}(no overlay)${R}
|
--texthooker Start texthooker server only ${D}(no overlay)${R}
|
||||||
|
|||||||
@@ -40,10 +40,17 @@ test('resolveWindowsMpvPath falls back to where.exe output', () => {
|
|||||||
assert.equal(resolved, 'C:\\tools\\mpv.exe');
|
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']), [
|
assert.deepEqual(buildWindowsMpvLaunchArgs(['C:\\a.mkv', 'C:\\b.mkv']), [
|
||||||
'--player-operation-mode=pseudo-gui',
|
'--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:\\a.mkv',
|
||||||
'C:\\b.mkv',
|
'C:\\b.mkv',
|
||||||
]);
|
]);
|
||||||
@@ -81,7 +88,7 @@ test('launchWindowsMpv spawns detached mpv with targets', () => {
|
|||||||
assert.equal(result.mpvPath, 'C:\\mpv\\mpv.exe');
|
assert.equal(result.mpvPath, 'C:\\mpv\\mpv.exe');
|
||||||
assert.deepEqual(calls, [
|
assert.deepEqual(calls, [
|
||||||
'C:\\mpv\\mpv.exe',
|
'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',
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,19 @@ export function resolveWindowsMpvPath(deps: WindowsMpvLaunchDeps): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function buildWindowsMpvLaunchArgs(targets: string[], extraArgs: string[] = []): 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(
|
export function launchWindowsMpv(
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ test('buildWindowsMpvShortcutDetails targets SubMiner.exe with --launch-mpv', ()
|
|||||||
target: 'C:\\Apps\\SubMiner\\SubMiner.exe',
|
target: 'C:\\Apps\\SubMiner\\SubMiner.exe',
|
||||||
args: '--launch-mpv',
|
args: '--launch-mpv',
|
||||||
cwd: 'C:\\Apps\\SubMiner',
|
cwd: 'C:\\Apps\\SubMiner',
|
||||||
description: 'Launch mpv with the SubMiner profile',
|
description: 'Launch mpv with SubMiner defaults',
|
||||||
icon: 'C:\\Apps\\SubMiner\\SubMiner.exe',
|
icon: 'C:\\Apps\\SubMiner\\SubMiner.exe',
|
||||||
iconIndex: 0,
|
iconIndex: 0,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export function buildWindowsMpvShortcutDetails(exePath: string): WindowsShortcut
|
|||||||
target: exePath,
|
target: exePath,
|
||||||
args: '--launch-mpv',
|
args: '--launch-mpv',
|
||||||
cwd: path.win32.dirname(exePath),
|
cwd: path.win32.dirname(exePath),
|
||||||
description: 'Launch mpv with the SubMiner profile',
|
description: 'Launch mpv with SubMiner defaults',
|
||||||
icon: exePath,
|
icon: exePath,
|
||||||
iconIndex: 0,
|
iconIndex: 0,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user