mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-16 16:46:09 -08:00
Compare commits
14
Commits
v0.21.0
...
2a0e931325
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a0e931325 | ||
|
|
0129e03c0f
|
||
|
|
586d7950cf
|
||
|
|
33dceabc3e
|
||
|
|
ad1abc3268
|
||
|
|
e59b78dca0 | ||
|
|
203a61a20f
|
||
|
|
a681bbaf25
|
||
|
|
6219a81144 | ||
|
|
cc9af79d6e | ||
|
|
d3a94536a8
|
||
|
|
3068d02f89
|
||
|
|
9150a60630 | ||
|
|
3549e0ed93 |
No files matched your search
@@ -56,7 +56,12 @@ jobs:
|
||||
|
||||
- name: Install mpv and ffmpeg (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: brew install mpv ffmpeg
|
||||
run: |
|
||||
# Runner images bake in different Homebrew metadata, so without an update the
|
||||
# installed mpv build depends on which image the job lands on.
|
||||
brew update
|
||||
brew install mpv ffmpeg
|
||||
mpv --version
|
||||
|
||||
- name: Install mpv and ffmpeg (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
|
||||
@@ -67,26 +67,26 @@ jobs:
|
||||
- name: Build unversioned AppImage
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
appimages=(release/SubMiner-*.AppImage)
|
||||
appimages=(dist/release/SubMiner-*.AppImage)
|
||||
if [ "${#appimages[@]}" -eq 0 ]; then
|
||||
echo "No versioned AppImage found to create unversioned artifact."
|
||||
ls -la release
|
||||
ls -la dist/release
|
||||
exit 1
|
||||
fi
|
||||
cp "${appimages[0]}" release/SubMiner.AppImage
|
||||
cp "${appimages[0]}" dist/release/SubMiner.AppImage
|
||||
|
||||
- name: Smoke packaged runtime assets
|
||||
shell: bash
|
||||
run: xvfb-run -a bun run test:package "release/linux-unpacked/resources"
|
||||
run: xvfb-run -a bun run test:package "dist/release/linux-unpacked/resources"
|
||||
|
||||
- name: Upload AppImage artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: appimage
|
||||
path: |
|
||||
release/*.AppImage
|
||||
release/latest*.yml
|
||||
release/*.blockmap
|
||||
dist/release/*.AppImage
|
||||
dist/release/latest*.yml
|
||||
dist/release/*.blockmap
|
||||
if-no-files-found: error
|
||||
|
||||
build-macos:
|
||||
@@ -159,17 +159,17 @@ jobs:
|
||||
|
||||
- name: Smoke packaged runtime assets
|
||||
shell: bash
|
||||
run: bun run test:package "release/mac-arm64/SubMiner.app/Contents/Resources"
|
||||
run: bun run test:package "dist/release/mac-arm64/SubMiner.app/Contents/Resources"
|
||||
|
||||
- name: Upload macOS artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macos
|
||||
path: |
|
||||
release/*.dmg
|
||||
release/*.zip
|
||||
release/latest*.yml
|
||||
release/*.blockmap
|
||||
dist/release/*.dmg
|
||||
dist/release/*.zip
|
||||
dist/release/latest*.yml
|
||||
dist/release/*.blockmap
|
||||
if-no-files-found: error
|
||||
|
||||
build-windows:
|
||||
@@ -224,15 +224,15 @@ jobs:
|
||||
|
||||
- name: Smoke packaged runtime assets
|
||||
shell: bash
|
||||
run: bun run test:package "release/win-unpacked/resources"
|
||||
run: bun run test:package "dist/release/win-unpacked/resources"
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows
|
||||
path: |
|
||||
release/*.exe
|
||||
release/*.zip
|
||||
release/latest*.yml
|
||||
release/*.blockmap
|
||||
dist/release/*.exe
|
||||
dist/release/*.zip
|
||||
dist/release/latest*.yml
|
||||
dist/release/*.blockmap
|
||||
if-no-files-found: error
|
||||
@@ -44,19 +44,19 @@ jobs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: appimage
|
||||
path: release
|
||||
path: dist/release
|
||||
|
||||
- name: Download macOS artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: macos
|
||||
path: release
|
||||
path: dist/release
|
||||
|
||||
- name: Download Windows artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows
|
||||
path: release
|
||||
path: dist/release
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
@@ -90,13 +90,15 @@ jobs:
|
||||
|
||||
- name: Package optional assets bundle
|
||||
run: |
|
||||
tar -czf "release/subminer-assets.tar.gz" \
|
||||
# Keep the archive layout stable for the AUR PKGBUILD.
|
||||
tar -czf "dist/release/subminer-assets.tar.gz" \
|
||||
--transform 's,^packaging/bun/licenses,resources/bun/licenses,' \
|
||||
config.example.jsonc \
|
||||
plugin/subminer \
|
||||
plugin/subminer.conf \
|
||||
assets/themes/subminer.rasi \
|
||||
assets/thumbnailers/subminer-ffmpegthumbnailer.thumbnailer \
|
||||
resources/bun/licenses
|
||||
packaging/bun/licenses
|
||||
|
||||
- name: Package Bun corresponding source
|
||||
run: bun scripts/package-bun-source.mjs
|
||||
@@ -104,16 +106,16 @@ jobs:
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
files=(release/*.AppImage release/*.dmg release/*.exe release/*.zip release/*.tar.gz release/latest*.yml release/*.blockmap dist/launcher/subminer dist/launcher/subminer.cmd)
|
||||
files=(dist/release/*.AppImage dist/release/*.dmg dist/release/*.exe dist/release/*.zip dist/release/*.tar.gz dist/release/latest*.yml dist/release/*.blockmap dist/launcher/subminer dist/launcher/subminer.cmd)
|
||||
if [ "${#files[@]}" -eq 0 ]; then
|
||||
echo "No release artifacts found for checksum generation."
|
||||
exit 1
|
||||
fi
|
||||
: > release/SHA256SUMS.txt
|
||||
: > dist/release/SHA256SUMS.txt
|
||||
for file in "${files[@]}"; do
|
||||
printf '%s %s\n' \
|
||||
"$(sha256sum "$file" | awk '{print $1}')" \
|
||||
"${file##*/}" >> release/SHA256SUMS.txt
|
||||
"${file##*/}" >> dist/release/SHA256SUMS.txt
|
||||
done
|
||||
|
||||
- name: Get version from tag
|
||||
@@ -124,12 +126,12 @@ jobs:
|
||||
env:
|
||||
RELEASE_VERSION: ${{ steps.version.outputs.VERSION }}
|
||||
run: |
|
||||
if [ ! -s release/prerelease-notes.md ]; then
|
||||
echo "::error::release/prerelease-notes.md is missing or empty. Run 'bun run changelog:prerelease-notes --version <version>' locally and commit the file before tagging."
|
||||
if [ ! -s packaging/release-notes/prerelease-notes.md ]; then
|
||||
echo "::error::packaging/release-notes/prerelease-notes.md is missing or empty. Run 'bun run changelog:prerelease-notes --version <version>' locally and commit the file before tagging."
|
||||
exit 1
|
||||
fi
|
||||
if ! bun run changelog:check-prerelease-notes --version "$RELEASE_VERSION"; then
|
||||
echo "::error::release/prerelease-notes.md was not generated for $RELEASE_VERSION. Rerun 'bun run changelog:prerelease-notes --version $RELEASE_VERSION' locally, commit, and retag."
|
||||
echo "::error::packaging/release-notes/prerelease-notes.md was not generated for $RELEASE_VERSION. Rerun 'bun run changelog:prerelease-notes --version $RELEASE_VERSION' locally, commit, and retag."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -142,15 +144,15 @@ jobs:
|
||||
|
||||
shopt -s nullglob
|
||||
artifacts=(
|
||||
release/*.AppImage
|
||||
release/*.dmg
|
||||
release/*.exe
|
||||
release/*.zip
|
||||
release/*.tar.gz
|
||||
release/*.tar.gz.sha256
|
||||
release/latest*.yml
|
||||
release/*.blockmap
|
||||
release/SHA256SUMS.txt
|
||||
dist/release/*.AppImage
|
||||
dist/release/*.dmg
|
||||
dist/release/*.exe
|
||||
dist/release/*.zip
|
||||
dist/release/*.tar.gz
|
||||
dist/release/*.tar.gz.sha256
|
||||
dist/release/latest*.yml
|
||||
dist/release/*.blockmap
|
||||
dist/release/SHA256SUMS.txt
|
||||
dist/launcher/subminer
|
||||
dist/launcher/subminer.cmd
|
||||
)
|
||||
@@ -165,14 +167,14 @@ jobs:
|
||||
--draft \
|
||||
--prerelease \
|
||||
--title "$RELEASE_VERSION" \
|
||||
--notes-file release/prerelease-notes.md
|
||||
--notes-file packaging/release-notes/prerelease-notes.md
|
||||
else
|
||||
gh release create "$RELEASE_VERSION" \
|
||||
--draft \
|
||||
--latest=false \
|
||||
--prerelease \
|
||||
--title "$RELEASE_VERSION" \
|
||||
--notes-file release/prerelease-notes.md
|
||||
--notes-file packaging/release-notes/prerelease-notes.md
|
||||
fi
|
||||
|
||||
for asset in "${artifacts[@]}"; do
|
||||
@@ -183,4 +185,4 @@ jobs:
|
||||
--draft=false \
|
||||
--prerelease \
|
||||
--title "$RELEASE_VERSION" \
|
||||
--notes-file release/prerelease-notes.md
|
||||
--notes-file packaging/release-notes/prerelease-notes.md
|
||||
@@ -45,19 +45,19 @@ jobs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: appimage
|
||||
path: release
|
||||
path: dist/release
|
||||
|
||||
- name: Download macOS artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: macos
|
||||
path: release
|
||||
path: dist/release
|
||||
|
||||
- name: Download Windows artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows
|
||||
path: release
|
||||
path: dist/release
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
@@ -91,13 +91,15 @@ jobs:
|
||||
|
||||
- name: Package optional assets bundle
|
||||
run: |
|
||||
tar -czf "release/subminer-assets.tar.gz" \
|
||||
# Keep the archive layout stable for the AUR PKGBUILD.
|
||||
tar -czf "dist/release/subminer-assets.tar.gz" \
|
||||
--transform 's,^packaging/bun/licenses,resources/bun/licenses,' \
|
||||
config.example.jsonc \
|
||||
plugin/subminer \
|
||||
plugin/subminer.conf \
|
||||
assets/themes/subminer.rasi \
|
||||
assets/thumbnailers/subminer-ffmpegthumbnailer.thumbnailer \
|
||||
resources/bun/licenses
|
||||
packaging/bun/licenses
|
||||
|
||||
- name: Package Bun corresponding source
|
||||
run: bun scripts/package-bun-source.mjs
|
||||
@@ -105,16 +107,16 @@ jobs:
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
files=(release/*.AppImage release/*.dmg release/*.exe release/*.zip release/*.tar.gz release/latest*.yml release/*.blockmap dist/launcher/subminer dist/launcher/subminer.cmd)
|
||||
files=(dist/release/*.AppImage dist/release/*.dmg dist/release/*.exe dist/release/*.zip dist/release/*.tar.gz dist/release/latest*.yml dist/release/*.blockmap dist/launcher/subminer dist/launcher/subminer.cmd)
|
||||
if [ "${#files[@]}" -eq 0 ]; then
|
||||
echo "No release artifacts found for checksum generation."
|
||||
exit 1
|
||||
fi
|
||||
: > release/SHA256SUMS.txt
|
||||
: > dist/release/SHA256SUMS.txt
|
||||
for file in "${files[@]}"; do
|
||||
printf '%s %s\n' \
|
||||
"$(sha256sum "$file" | awk '{print $1}')" \
|
||||
"${file##*/}" >> release/SHA256SUMS.txt
|
||||
"${file##*/}" >> dist/release/SHA256SUMS.txt
|
||||
done
|
||||
|
||||
- name: Get version from tag
|
||||
@@ -152,24 +154,24 @@ jobs:
|
||||
gh release edit "$RELEASE_VERSION" \
|
||||
--draft=false \
|
||||
--title "$RELEASE_VERSION" \
|
||||
--notes-file release/release-notes.md
|
||||
--notes-file packaging/release-notes/release-notes.md
|
||||
else
|
||||
gh release create "$RELEASE_VERSION" \
|
||||
--title "$RELEASE_VERSION" \
|
||||
--notes-file release/release-notes.md
|
||||
--notes-file packaging/release-notes/release-notes.md
|
||||
fi
|
||||
|
||||
shopt -s nullglob
|
||||
artifacts=(
|
||||
release/*.AppImage
|
||||
release/*.dmg
|
||||
release/*.exe
|
||||
release/*.zip
|
||||
release/*.tar.gz
|
||||
release/*.tar.gz.sha256
|
||||
release/latest*.yml
|
||||
release/*.blockmap
|
||||
release/SHA256SUMS.txt
|
||||
dist/release/*.AppImage
|
||||
dist/release/*.dmg
|
||||
dist/release/*.exe
|
||||
dist/release/*.zip
|
||||
dist/release/*.tar.gz
|
||||
dist/release/*.tar.gz.sha256
|
||||
dist/release/latest*.yml
|
||||
dist/release/*.blockmap
|
||||
dist/release/SHA256SUMS.txt
|
||||
dist/launcher/subminer
|
||||
dist/launcher/subminer.cmd
|
||||
)
|
||||
|
||||
+1
-7
@@ -8,11 +8,6 @@ node_modules/
|
||||
# Electron build output
|
||||
out/
|
||||
dist/
|
||||
release/*
|
||||
!release/
|
||||
!release/release-notes.md
|
||||
!release/prerelease-notes.md
|
||||
build/yomitan/
|
||||
coverage/
|
||||
|
||||
# Launcher build artifact (produced by make build-launcher)
|
||||
@@ -20,8 +15,6 @@ coverage/
|
||||
/main-entry.js
|
||||
/main-entry.js.map
|
||||
|
||||
/build/hachidori/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
@@ -43,6 +36,7 @@ environment.toml
|
||||
.vitepress/dist/
|
||||
docs/.vitepress/cache/
|
||||
docs/.vitepress/dist/
|
||||
# Local test media and scripts
|
||||
tests/*
|
||||
.worktrees/
|
||||
.tmp/
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
node_modules
|
||||
dist
|
||||
release
|
||||
coverage
|
||||
vendor
|
||||
*.log
|
||||
src/core/services/tokenizer/__fixtures__/golden/*.json
|
||||
# Reviewed release text and vendored license texts; never reformat
|
||||
packaging/release-notes
|
||||
packaging/bun/licenses
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"printWidth": 100,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
@@ -1,5 +1,28 @@
|
||||
# Changelog
|
||||
|
||||
## v0.21.1 (2026-10-26)
|
||||
|
||||
### Changed
|
||||
- **Stats Session View**: Redesigned the expanded session view in the stats dashboard.
|
||||
- New stat tiles show pace, lines, known-word rate, lookups, and paused time.
|
||||
- A reading density chart of known and unknown words replaces the cumulative chart.
|
||||
- Yomitan lookups and mined cards now appear in their own lane below the chart.
|
||||
|
||||
### Fixed
|
||||
- **Subtitle Retiming**: Mining, the subtitle sidebar, subtitle navigation, and replay now use the timing you set with mpv's subtitle delay keys (z/x and sub-step), so mined audio and images match the retimed line.
|
||||
- **Subtitle Sidebar**: mpv keys and mouse actions, like volume keys and double-click fullscreen, work again while the sidebar is open.
|
||||
|
||||
### Docs
|
||||
- **README**: Refreshed the anime screenshots using the current build.
|
||||
|
||||
<details>
|
||||
<summary>Internal changes</summary>
|
||||
|
||||
### Internal
|
||||
- **Packaging Layout**: Packaging inputs now live under `packaging/`, and all build output lands in `dist/`, with packaged apps in `dist/release/`.
|
||||
|
||||
</details>
|
||||
|
||||
## v0.21.0 (2026-10-24)
|
||||
|
||||
### Added
|
||||
|
||||
@@ -21,11 +21,10 @@ MACOS_DATA_DIR ?= $(HOME)/Library/Application Support/SubMiner
|
||||
MACOS_APP_DIR ?= $(HOME)/Applications
|
||||
MACOS_APP_DEST ?= $(MACOS_APP_DIR)/SubMiner.app
|
||||
|
||||
# If building from source, the AppImage will typically land in release/.
|
||||
APPIMAGE_SRC = $(firstword $(wildcard release/SubMiner-*.AppImage))
|
||||
MACOS_APP_SRC = $(firstword $(wildcard release/*.app release/*/*.app))
|
||||
MACOS_ZIP_SRC = $(firstword $(wildcard release/SubMiner-*.zip))
|
||||
PRERELEASE_NOTES := release/prerelease-notes.md
|
||||
# If building from source, the AppImage will typically land in dist/release/.
|
||||
APPIMAGE_SRC = $(firstword $(wildcard dist/release/SubMiner-*.AppImage))
|
||||
MACOS_APP_SRC = $(firstword $(wildcard dist/release/*.app dist/release/*/*.app))
|
||||
MACOS_ZIP_SRC = $(firstword $(wildcard dist/release/SubMiner-*.zip))
|
||||
|
||||
UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown)
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@@ -57,7 +56,7 @@ help:
|
||||
" build-linux Build Linux AppImage" \
|
||||
" build-macos Build macOS DMG/ZIP (signed if configured)" \
|
||||
" build-macos-unsigned Build macOS DMG/ZIP without signing/notarization" \
|
||||
" clean Remove build artifacts (dist/, release/, AppImage, binary)" \
|
||||
" clean Remove build artifacts (dist/, AppImage, binary)" \
|
||||
" dev-start Build and launch local Electron app" \
|
||||
" dev-start-macos Build and launch local Electron app with macOS tracker backend" \
|
||||
" dev-watch Start fast watch loop (tsc + renderer + Electron dev app)" \
|
||||
@@ -165,15 +164,7 @@ build-launcher:
|
||||
|
||||
clean:
|
||||
@printf '%s\n' "[INFO] Removing build artifacts"
|
||||
@if [ -f "$(PRERELEASE_NOTES)" ]; then \
|
||||
PRERELEASE_NOTES_BACKUP="$$(mktemp -t subminer-prerelease-notes.XXXXXX)" && \
|
||||
cp "$(PRERELEASE_NOTES)" "$$PRERELEASE_NOTES_BACKUP" && \
|
||||
rm -rf dist release && \
|
||||
install -d release && \
|
||||
mv "$$PRERELEASE_NOTES_BACKUP" "$(PRERELEASE_NOTES)"; \
|
||||
else \
|
||||
rm -rf dist release; \
|
||||
fi
|
||||
@rm -rf dist
|
||||
@rm -f "$(BINDIR)/subminer" "$(BINDIR)/SubMiner.AppImage"
|
||||
|
||||
generate-config: ensure-bun
|
||||
@@ -229,7 +220,7 @@ install-linux: build-launcher
|
||||
@if [ -n "$(APPIMAGE_SRC)" ]; then \
|
||||
install -m 0755 "$(APPIMAGE_SRC)" "$(BINDIR)/SubMiner.AppImage"; \
|
||||
else \
|
||||
printf '%s\n' "[WARN] No release/SubMiner-*.AppImage found; skipping AppImage install"; \
|
||||
printf '%s\n' "[WARN] No dist/release/SubMiner-*.AppImage found; skipping AppImage install"; \
|
||||
printf '%s\n' " Build one with: make build"; \
|
||||
fi
|
||||
@printf '%s\n' "Installed to:" " $(BINDIR)/subminer" " $(LINUX_DATA_DIR)/themes/$(THEME_FILE)" " $(LINUX_DATA_DIR)/thumbnailers/$(THUMBNAILER_FILE)"
|
||||
@@ -252,7 +243,7 @@ install-macos: build-launcher
|
||||
ditto -x -k "$(MACOS_ZIP_SRC)" "$(MACOS_APP_DIR)"; \
|
||||
printf '%s\n' "[INFO] Installed app bundle from $(MACOS_ZIP_SRC)"; \
|
||||
else \
|
||||
printf '%s\n' "[WARN] No macOS app bundle or zip found in release/; skipping app install"; \
|
||||
printf '%s\n' "[WARN] No macOS app bundle or zip found in dist/release/; skipping app install"; \
|
||||
printf '%s\n' " Build one with: make build"; \
|
||||
fi
|
||||
@printf '%s\n' "Installed to:" " $(BINDIR)/subminer" " $(MACOS_DATA_DIR)/themes/$(THEME_FILE)" " $(MACOS_APP_DEST)"
|
||||
|
||||
@@ -25,7 +25,7 @@ Look up words with Yomitan or Hachidori, mine them to Anki, and track your immer
|
||||
|
||||
Hover over any word in the subtitles to open the full Yomitan popup with definitions, pitch accent, and frequency data. SubMiner bundles its own Yomitan, separate from any browser install.
|
||||
|
||||
Yomitan remains the default. Select the bundled Hachidori backend with `dictionaryBackend: "hachidori"` and restart SubMiner. The tray opens the selected backend's settings. See [dictionary setup](https://docs.subminer.moe/usage#hachidori-setup) for importing dictionaries, linking an external Hachidori host, and configuring Anki.
|
||||
Yomitan remains the default. Select the bundled [Hachidori](https://github.com/bee-san/hachidori) backend with `dictionaryBackend: "hachidori"` and restart SubMiner. The tray opens the selected backend's settings. See [dictionary setup](https://docs.subminer.moe/usage#hachidori-setup) for importing dictionaries, linking an external Hachidori host, and configuring Anki.
|
||||
|
||||
<div align="center">
|
||||
<img src="docs-site/public/screenshots/yomitan-lookup.png" width="800" alt="Yomitan dictionary popup over annotated subtitles in mpv">
|
||||
@@ -38,7 +38,7 @@ Yomitan remains the default. Select the bundled Hachidori backend with `dictiona
|
||||
Create an Anki card from the exact playback moment with one key press, click, or controller input. SubMiner fills in the sentence, an audio clip, and a screenshot or animated image.
|
||||
|
||||
<div align="center">
|
||||
<img src="docs-site/public/screenshots/one-key-mining.png" width="800" alt="Anki card created from SubMiner with sentence, audio, and screenshot">
|
||||
<img src="docs-site/public/screenshots/one-key-mining.png" width="800" alt="Yomitan lookup over an anime scene with Anki mining controls">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
@@ -48,7 +48,7 @@ Create an Anki card from the exact playback moment with one key press, click, or
|
||||
Subtitles are annotated as they play with frequency highlighting, JLPT tags, N+1 targeting, and character names from a generated dictionary. Particles and grammar-only tokens stay plain so the words worth learning stand out.
|
||||
|
||||
<div align="center">
|
||||
<img src="docs-site/public/screenshots/annotations.png" width="800" alt="Annotated subtitles with frequency coloring, JLPT underlines, and N+1 targets">
|
||||
<img src="docs-site/public/screenshots/annotations.png" width="800" alt="Annotated subtitles with frequency colors, character portraits, and JLPT underlines">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"brace-expansion": "5.0.11",
|
||||
"electron-builder-squirrel-windows": "26.16.1",
|
||||
"fast-uri": "3.1.7",
|
||||
"follow-redirects": "1.16.1",
|
||||
"follow-redirects": "1.16.2",
|
||||
"form-data": "4.0.6",
|
||||
"ip-address": "10.2.0",
|
||||
"js-yaml": "4.3.2",
|
||||
@@ -351,7 +351,7 @@
|
||||
|
||||
"filelist": ["filelist@1.0.6", "", { "dependencies": { "minimatch": "^5.0.1" } }, "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA=="],
|
||||
|
||||
"follow-redirects": ["follow-redirects@1.16.1", "", { "peerDependencies": { "debug": "*" }, "optionalPeers": ["debug"] }, "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg=="],
|
||||
"follow-redirects": ["follow-redirects@1.16.2", "", {}, "sha512-/kVP2U8z596Ia0gwFrwyIeo74ta5aVmSeU1FfAUMAmcEP5EP7zydmag3SLiN64NaRKef3lxsq7i/g7ltJQDGow=="],
|
||||
|
||||
"form-data": ["form-data@4.0.6", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.4", "mime-types": "^2.1.35" } }, "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ=="],
|
||||
|
||||
|
||||
+2
-2
@@ -44,11 +44,11 @@ How fragments turn into a release:
|
||||
- The polish step treats pending fragments as the final release outcome, not prerelease history. If a feature is added and then renamed or fixed before the stable cut, ship the final feature bullet instead of separate prerelease-only breaking/fix entries.
|
||||
- `CHANGELOG.md`, GitHub release notes, and prerelease notes all use one item per feature or area, inline by default: `- **Name**: one or two short sentences.` Items with several separate changes may use a few short nested bullets instead of a run-on sentence. Items say what changed and how to reach it; implementation details, edge cases, and step-by-step usage belong in the docs, not the release body.
|
||||
- `internal` fragments stay in `CHANGELOG.md` (inside a collapsed `<details>` block) but are dropped from the GitHub release notes entirely.
|
||||
- The polished `CHANGELOG.md` and `release/release-notes.md` are committed and reviewed before tagging — edit the Markdown by hand if Claude misses something.
|
||||
- The polished `CHANGELOG.md` and `packaging/release-notes/release-notes.md` are committed and reviewed before tagging — edit the Markdown by hand if Claude misses something.
|
||||
|
||||
Prerelease notes:
|
||||
|
||||
- prerelease tags like `v0.11.3-beta.1` and `v0.11.3-rc.1` reuse the current pending fragments to generate `release/prerelease-notes.md`
|
||||
- prerelease tags like `v0.11.3-beta.1` and `v0.11.3-rc.1` reuse the current pending fragments to generate `packaging/release-notes/prerelease-notes.md`
|
||||
- from the second prerelease of a base version onward, the notes also open with a `## Changes since <previous tag>` section generated from the fragment diff against the previous beta/RC tag; keep fragment edits meaningful. Editorial-only rewording is filtered out of that section, while genuinely changed behavior and deleted fragments (reverted changes) are reported
|
||||
- existing prerelease notes are a reviewed baseline; later prerelease runs should replace stale beta/RC wording with the current outcome instead of appending fix churn
|
||||
- prerelease note generation does not consume fragments and does not update `CHANGELOG.md` or `docs-site/changelog.md`
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
type: fixed
|
||||
area: anilist
|
||||
|
||||
- AniList progress sync now adds a show to your Watching list (or Completed on the final episode) when it is not on your list yet, instead of failing with "AniList update not possible". This only happens when the file title exactly matches an AniList title or the entry is pinned with the character dictionary override; loose matches still require adding the show yourself.
|
||||
- Entries marked Completed, Paused, Dropped, or Rewatching are still never changed.
|
||||
@@ -0,0 +1,4 @@
|
||||
type: fixed
|
||||
area: anki
|
||||
|
||||
- `ankiConnect.fields.audio` now defaults to `SentenceAudio` instead of `ExpressionAudio`, so generated sentence audio no longer overwrites Yomitan's word audio on default configs. `fields.wordAudio` still defaults to `ExpressionAudio`. If you relied on the old default, set `fields.audio` to `ExpressionAudio` explicitly.
|
||||
@@ -0,0 +1,4 @@
|
||||
type: fixed
|
||||
area: linux
|
||||
|
||||
- Fixed AppImage builds on Ubuntu 26.04+ (uutils coreutils) releasing their mount before Chromium child processes finished shutting down, which brought back "Service Crash" notifications on quit.
|
||||
@@ -578,7 +578,7 @@
|
||||
"deck": "", // Restrict duplicate detection and card enrichment to this Anki deck. Leave empty to use the Yomitan mining deck when available.
|
||||
"fields": {
|
||||
"word": "Expression", // Card field for the mined word or expression text.
|
||||
"audio": "ExpressionAudio", // Card field that receives generated sentence audio.
|
||||
"audio": "SentenceAudio", // Card field that receives generated sentence audio.
|
||||
"wordAudio": "ExpressionAudio", // Existing word-audio field read to time the frozen first frame of animated images. This mapping is only used for synchronization.
|
||||
"image": "Picture", // Card field that receives the captured screenshot or animated image.
|
||||
"sentence": "Sentence", // Card field that receives the source sentence text.
|
||||
|
||||
@@ -29,7 +29,7 @@ An episode counts as watched after 85% of its length and at least 10 minutes of
|
||||
2. Finds the matching AniList entry. For season 2 and later, it follows the show's sequels.
|
||||
3. Sets your progress to that episode and marks the entry Watching, or Completed on the final episode.
|
||||
|
||||
The show must already be on your Planning or Watching list. SubMiner does not add new entries, and it never lowers your progress.
|
||||
If the show is not on your list yet, SubMiner adds it as Watching, but only when the file title exactly matches an AniList title or you pinned the entry with the character dictionary's AniList override. For a looser match, add the show to Planning or Watching yourself. SubMiner never changes entries marked Completed, Paused, Dropped, or Rewatching, and it never lowers your progress.
|
||||
|
||||
Failed updates are saved and retried in the background, up to 8 times with growing delays. The queue survives restarts.
|
||||
|
||||
@@ -61,7 +61,7 @@ Character dictionary settings live under `anilist.characterDictionary` and are c
|
||||
|
||||
**No update after an episode.** Check that `anilist.enabled` is `true` and that you watched at least 85% of the episode.
|
||||
|
||||
**"AniList update not possible."** Add the show to your Planning or Watching list, then mark the episode watched again.
|
||||
**"AniList update not possible."** The show is marked Completed, Paused, Dropped, or Rewatching, or it is not on your list and the title match was not exact. Add the show to your Planning or Watching list, or pin it with the character dictionary's AniList override, then mark the episode watched again.
|
||||
|
||||
**Wrong show or episode.** Install guessit and make sure it is on your `PATH`. Unusual file names parse poorly without it.
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ Field names are matched case-insensitively. A mapped field that is missing from
|
||||
|
||||
Hachidori prepares downloadable word audio before it saves a note through the proxy, so the animated image delay works on the first mine. Set a downloadable pronunciation source in Hachidori's Audio settings. Browser speech cannot be saved to Anki. Without word audio, Hachidori shows a warning and the card gets no word-audio hold.
|
||||
|
||||
`fields.audio` gets sentence audio, not word audio. Yomitan writes its own dictionary audio into your note, so point `fields.audio` at a separate field such as `SentenceAudio`. The default, `ExpressionAudio`, is the field many note types use for Yomitan's word audio, so leaving it would overwrite that audio.
|
||||
`fields.audio` gets sentence audio, not word audio. Yomitan writes its own dictionary audio into your note (often `ExpressionAudio`), so keep `fields.audio` pointed at a separate field such as the default `SentenceAudio`. Pointing it at Yomitan's word-audio field would overwrite that audio.
|
||||
|
||||
`ankiConnect.tags` adds tags to every mined or updated card. Set it to `[]` to add none.
|
||||
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# Changelog
|
||||
|
||||
## v0.21.1 (2026-10-26)
|
||||
|
||||
**Changed**
|
||||
- **Stats Session View**: Redesigned the expanded session view in the stats dashboard.
|
||||
- New stat tiles show pace, lines, known-word rate, lookups, and paused time.
|
||||
- A reading density chart of known and unknown words replaces the cumulative chart.
|
||||
- Yomitan lookups and mined cards now appear in their own lane below the chart.
|
||||
|
||||
**Fixed**
|
||||
- **Subtitle Retiming**: Mining, the subtitle sidebar, subtitle navigation, and replay now use the timing you set with mpv's subtitle delay keys (z/x and sub-step), so mined audio and images match the retimed line.
|
||||
- **Subtitle Sidebar**: mpv keys and mouse actions, like volume keys and double-click fullscreen, work again while the sidebar is open.
|
||||
|
||||
**Docs**
|
||||
- **README**: Refreshed the anime screenshots using the current build.
|
||||
|
||||
<details>
|
||||
<summary>Internal changes</summary>
|
||||
|
||||
**Internal**
|
||||
- **Packaging Layout**: Packaging inputs now live under `packaging/`, and all build output lands in `dist/`, with packaged apps in `dist/release/`.
|
||||
|
||||
</details>
|
||||
|
||||
## v0.21.0 (2026-10-24)
|
||||
|
||||
**Added**
|
||||
|
||||
@@ -329,15 +329,15 @@ Creates and updates Anki cards with sentence, audio, and screenshot. Needs the [
|
||||
|
||||
**Fields**
|
||||
|
||||
| Key | Default | What it does |
|
||||
| ------------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `ankiConnect.fields.word` | `"Expression"` | Word field |
|
||||
| `ankiConnect.fields.audio` | `"ExpressionAudio"` | Field that receives sentence audio. Set a separate field such as `SentenceAudio` so it does not overwrite Yomitan's word audio |
|
||||
| `ankiConnect.fields.wordAudio` | `"ExpressionAudio"` | Existing word-audio field, read only to time animated images |
|
||||
| `ankiConnect.fields.image` | `"Picture"` | Screenshot field |
|
||||
| `ankiConnect.fields.sentence` | `"Sentence"` | Sentence field |
|
||||
| `ankiConnect.fields.miscInfo` | `"MiscInfo"` | Metadata field. `null` disables |
|
||||
| `ankiConnect.metadata.pattern` | `"[SubMiner] %f (%t)"` | MiscInfo template: `%f` filename, `%F` filename with extension, `%t` time, `%T` time with ms, `<br>` newline |
|
||||
| Key | Default | What it does |
|
||||
| ------------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `ankiConnect.fields.word` | `"Expression"` | Word field |
|
||||
| `ankiConnect.fields.audio` | `"SentenceAudio"` | Field that receives sentence audio. Keep it separate from Yomitan's word-audio field so it does not overwrite that audio |
|
||||
| `ankiConnect.fields.wordAudio` | `"ExpressionAudio"` | Existing word-audio field, read only to time animated images |
|
||||
| `ankiConnect.fields.image` | `"Picture"` | Screenshot field |
|
||||
| `ankiConnect.fields.sentence` | `"Sentence"` | Sentence field |
|
||||
| `ankiConnect.fields.miscInfo` | `"MiscInfo"` | Metadata field. `null` disables |
|
||||
| `ankiConnect.metadata.pattern` | `"[SubMiner] %f (%t)"` | MiscInfo template: `%f` filename, `%F` filename with extension, `%t` time, `%T` time with ms, `<br>` newline |
|
||||
|
||||
**Media**
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ Charts for watch time, cards, words, and sessions per day or month, running tota
|
||||
|
||||
### Sessions
|
||||
|
||||
Session history with new-word activity and pause, seek, and card markers. The **↗** button on a row opens that show's detail view.
|
||||
Session history. Expand a session for its pace, lines, known-word rate, lookups, and paused time, plus a reading density chart of known and unknown words over the session with Yomitan lookup ticks and clickable card-mined markers underneath. The **↗** button on a row opens that show's detail view.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ make deps
|
||||
make build-macos
|
||||
```
|
||||
|
||||
The `.dmg` and `.zip` land in `release/`. For an unsigned local build, run `bun run build:mac:unsigned`.
|
||||
The `.dmg` and `.zip` land in `dist/release/`. For an unsigned local build, run `bun run build:mac:unsigned`.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@
|
||||
"deck": "", // Restrict duplicate detection and card enrichment to this Anki deck. Leave empty to use the Yomitan mining deck when available.
|
||||
"fields": {
|
||||
"word": "Expression", // Card field for the mined word or expression text.
|
||||
"audio": "ExpressionAudio", // Card field that receives generated sentence audio.
|
||||
"audio": "SentenceAudio", // Card field that receives generated sentence audio.
|
||||
"wordAudio": "ExpressionAudio", // Existing word-audio field read to time the frozen first frame of animated images. This mapping is only used for synchronization.
|
||||
"image": "Picture", // Card field that receives the captured screenshot or animated image.
|
||||
"sentence": "Sentence", // Card field that receives the source sentence text.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 614 KiB After Width: | Height: | Size: 1.9 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 2.2 MiB |
@@ -86,7 +86,7 @@ SubMiner detected that a previously non-empty Yomitan profile suddenly appears e
|
||||
|
||||
## "Yomitan extension not found in any search path"
|
||||
|
||||
The bundled Yomitan is missing. Re-download the AppImage, or place an unpacked Yomitan extension in `~/.config/SubMiner/yomitan`. Source builds must run `bun run build` first to produce `build/yomitan`.
|
||||
The bundled Yomitan is missing. Re-download the AppImage, or place an unpacked Yomitan extension in `~/.config/SubMiner/yomitan`. Source builds must run `bun run build` first to produce `dist/yomitan`.
|
||||
|
||||
## "MeCab not found on system"
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ The bundled Yomitan is separate from any Yomitan in your browser. It has its own
|
||||
|
||||
### Hachidori setup
|
||||
|
||||
Hachidori is an alternative lookup backend. Set `dictionaryBackend` to `"hachidori"` in settings or `config.jsonc`, then restart SubMiner. Set it back to `"yomitan"` and restart to switch back.
|
||||
[Hachidori](https://github.com/bee-san/hachidori) is an alternative lookup backend. Set `dictionaryBackend` to `"hachidori"` in settings or `config.jsonc`, then restart SubMiner. Set it back to `"yomitan"` and restart to switch back.
|
||||
|
||||
Open Hachidori settings with `Alt+Shift+Y`, the tray's **Open Hachidori Settings**, or `subminer app --hachidori`. Import dictionary ZIPs or use Hachidori's recommended dictionary installer, then set up its Anki template (SubMiner [fills in what it can](/anki-integration#hachidori-settings-from-subminer)). Yomitan and Hachidori keep separate dictionaries and settings. Yomitan profiles, custom Handlebars templates, and `yomitan.externalProfilePath` do not carry over. Subtitle annotations and lookups wait while Hachidori imports a dictionary, so large imports pause them until the import finishes.
|
||||
|
||||
|
||||
+10
-10
@@ -54,10 +54,10 @@ files before signing and generating updater hashes, never from a signed app.
|
||||
4. Bump `package.json` to the release version.
|
||||
5. Build release metadata before tagging (this calls `claude -p` locally):
|
||||
`bun run changelog:build --version <version> --date <yyyy-mm-dd>`
|
||||
- The polished `CHANGELOG.md` and `release/release-notes.md` are committed
|
||||
- The polished `CHANGELOG.md` and `packaging/release-notes/release-notes.md` are committed
|
||||
before tagging. Release CI no longer auto-builds the changelog; it fails
|
||||
fast if `changes/*.md` fragments are still present on a tag-based run.
|
||||
6. Review `CHANGELOG.md` and `release/release-notes.md`. Edit by hand if Claude
|
||||
6. Review `CHANGELOG.md` and `packaging/release-notes/release-notes.md`. Edit by hand if Claude
|
||||
missed something — the committed Markdown is what ships.
|
||||
7. Run release gate locally:
|
||||
`bun run changelog:check --version <version>`
|
||||
@@ -73,9 +73,9 @@ files before signing and generating updater hashes, never from a signed app.
|
||||
`bun-v<version>-source.tar.gz` plus its `.sha256` file. The script
|
||||
fails if Bun's CMake dependency pins, WebKit pin, source checksums, patch
|
||||
inputs, or collected license files differ from
|
||||
`build/bun-source-manifest.json`.
|
||||
`packaging/bun/bun-source-manifest.json`.
|
||||
When validating auto-update metadata, also run the relevant platform package
|
||||
build and confirm `release/` contains the generated updater metadata
|
||||
build and confirm `dist/release/` contains the generated updater metadata
|
||||
(`latest*.yml`) and blockmaps (`*.blockmap`).
|
||||
8. If `docs-site/` changed, also run:
|
||||
`bun run docs:test`
|
||||
@@ -103,9 +103,9 @@ files before signing and generating updater hashes, never from a signed app.
|
||||
source archive. A missing source repository or license file fails the
|
||||
release instead of publishing only the executable.
|
||||
When validating packaged updater output, confirm the platform build writes
|
||||
`latest*.yml` and `*.blockmap` files under `release/`.
|
||||
`latest*.yml` and `*.blockmap` files under `dist/release/`.
|
||||
5. Commit the prerelease prep (package.json version bump + the generated
|
||||
`release/prerelease-notes.md`). CI does not regenerate notes — it uses the
|
||||
`packaging/release-notes/prerelease-notes.md`). CI does not regenerate notes — it uses the
|
||||
committed file — so review it before committing. Rerun
|
||||
`bun run changelog:prerelease-notes --version <version>` for every later
|
||||
beta/RC, even if no fragments changed: the notes carry a hidden
|
||||
@@ -128,14 +128,14 @@ Notes:
|
||||
- Supported prerelease channels are `beta` and `rc`, with versions like `0.11.3-beta.1` and `0.11.3-rc.1`.
|
||||
- Pass `--date` explicitly when you want the release stamped with the local cut date; otherwise the generator uses the current ISO date, which can roll over to the next UTC day late at night.
|
||||
- `changelog:check` now rejects tag/package version mismatches.
|
||||
- `changelog:prerelease-notes` also rejects tag/package version mismatches and writes `release/prerelease-notes.md` without mutating tracked changelog files. When that file already exists, the generator includes it in the Claude prompt so later beta/RC notes reuse the reviewed text instead of starting over.
|
||||
- `changelog:prerelease-notes` also rejects tag/package version mismatches and writes `packaging/release-notes/prerelease-notes.md` without mutating tracked changelog files. When that file already exists, the generator includes it in the Claude prompt so later beta/RC notes reuse the reviewed text instead of starting over.
|
||||
- From the second prerelease of a base version onward, the notes open with a `## Changes since <previous tag>` section above the cumulative `## Highlights`. The generator locates the newest preceding beta/RC tag for the same base version (semver order: all betas before all RCs), diffs `changes/*.md` between that tag and the working tree, and asks Claude to describe only the behavioral beta-to-beta differences — added fragments as new changes, modified fragments by their before/after difference (editorial-only edits are dropped), deleted fragments as removed/reverted changes. If no fragments changed (for example a packaging-only rebuild), the section states that explicitly without a Claude call. The delta section carries no separate contributor attribution; `## What's Changed` stays cumulative like `## Highlights`.
|
||||
- `changelog:check-prerelease-notes --version <version>` verifies the committed notes' `prerelease-version` marker matches the version being tagged; the prerelease workflow runs it and fails the release on stale notes.
|
||||
- `changelog:build` generates `CHANGELOG.md` + `release/release-notes.md` (both polished by `claude -p`) and removes the released `changes/*.md` fragments. The CHANGELOG keeps internal notes inside a `<details><summary>Internal changes</summary>` collapse; the release notes drop them entirely.
|
||||
- `release/release-notes.md` (and `release/prerelease-notes.md`) include GitHub-style attribution after `## Highlights`: a `## What's Changed` list crediting each released fragment as `by @<author> in #<pr>`, plus a `## New Contributors` section for first-time authors. Attribution is resolved per fragment via `git log` (the commit that added the fragment) + `gh api .../commits/<sha>/pulls`, with one `gh` search per author for the first-contribution check. It needs `gh` installed and authenticated; if `gh` is unavailable or a lookup fails, the generator warns and emits notes without the attribution sections rather than failing. The CHANGELOG itself stays attribution-free.
|
||||
- `changelog:build` generates `CHANGELOG.md` + `packaging/release-notes/release-notes.md` (both polished by `claude -p`) and removes the released `changes/*.md` fragments. The CHANGELOG keeps internal notes inside a `<details><summary>Internal changes</summary>` collapse; the release notes drop them entirely.
|
||||
- `packaging/release-notes/release-notes.md` (and `packaging/release-notes/prerelease-notes.md`) include GitHub-style attribution after `## Highlights`: a `## What's Changed` list crediting each released fragment as `by @<author> in #<pr>`, plus a `## New Contributors` section for first-time authors. Attribution is resolved per fragment via `git log` (the commit that added the fragment) + `gh api .../commits/<sha>/pulls`, with one `gh` search per author for the first-contribution check. It needs `gh` installed and authenticated; if `gh` is unavailable or a lookup fails, the generator warns and emits notes without the attribution sections rather than failing. The CHANGELOG itself stays attribution-free.
|
||||
- The release workflow no longer auto-runs `changelog:build`. If pending `changes/*.md` fragments are present on a tag-based run, CI exits with a clear `::error::` pointing at the local fix. Run `bun run changelog:build --version <version>` locally, commit the polished output, then tag.
|
||||
- Do not tag while `changes/*.md` fragments still exist.
|
||||
- Prerelease tags intentionally keep `changes/*.md` fragments in place so multiple prereleases can reuse the same cumulative pending notes until the final stable cut. `make clean` preserves `release/prerelease-notes.md` while deleting generated build artifacts.
|
||||
- Prerelease tags intentionally keep `changes/*.md` fragments in place so multiple prereleases can reuse the same cumulative pending notes until the final stable cut.
|
||||
- If you need to repair a published release body (for example, a prior version’s section was omitted), regenerate notes from `CHANGELOG.md` and re-edit the release with `gh release edit --notes-file`.
|
||||
- Prerelease tags are handled by `.github/workflows/prerelease.yml`, which always publishes a GitHub prerelease with all current release platforms and never runs the AUR sync job.
|
||||
- CI, stable release, and prerelease workflows call the shared `.github/workflows/quality-gate.yml`; update that reusable workflow when changing common test coverage. Its environment suite includes the Lua mpv plugin tests.
|
||||
|
||||
@@ -19,6 +19,8 @@ Renderer, launcher, plugin, and stats each keep their own local layering and sho
|
||||
## Rules
|
||||
|
||||
- Keep `src/main.ts` thin; wire, do not implement.
|
||||
- Pass deps straight to a handler factory (`createXHandler({...})`). Do not add
|
||||
`*-main-deps.ts` builders that only re-wrap deps; existing ones are being removed.
|
||||
- Prefer injecting dependencies from `src/main/` instead of reaching outward from core services.
|
||||
- Keep side effects explicit and close to composition boundaries.
|
||||
- Put reusable business logic in focused services, not in top-level lifecycle files.
|
||||
|
||||
@@ -62,7 +62,7 @@ bun run docs:build
|
||||
then `bun run test:e2e` (see [Headless End-to-End Harness](#headless-end-to-end-harness))
|
||||
- Build/release scripts (`scripts/**`): `bun run test:scripts`
|
||||
- Packaging: build the platform package, then run `bun run test:package <resources-directory>`.
|
||||
On headless Linux: `xvfb-run -a bun run test:package release/linux-unpacked/resources`.
|
||||
On headless Linux: `xvfb-run -a bun run test:package dist/release/linux-unpacked/resources`.
|
||||
Content checks run inside the electron-builder afterPack hook. See the
|
||||
[release guide](../RELEASING.md#package-contents-checks) for the
|
||||
installed-app verification checklist.
|
||||
@@ -125,7 +125,8 @@ whenever the behavior does not depend on a specific compositor.
|
||||
- Scenarios live in `e2e/*.e2e.test.ts` and share one session per file through
|
||||
`startE2eSession()`. Pass `config` to override settings for a scenario file.
|
||||
- On a failed startup the temp dir is kept and its path is in the error. Set
|
||||
`SUBMINER_E2E_KEEP=1` to keep it after any run (`app-stdio.log`, `app.log`, `mpv.log`).
|
||||
`SUBMINER_E2E_KEEP=1` to keep it after any run (`app-stdio.log`, `app.log`, `mpv.log`,
|
||||
`mpv-stdio.log`).
|
||||
|
||||
For exploratory checks, keep one session up and poke at it:
|
||||
|
||||
|
||||
@@ -37,10 +37,12 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
// A recording AnkiConnect stand-in: an empty collection with one deck and one
|
||||
// Lapis-shaped note type. Scenarios assert on `requests`, not on stored notes.
|
||||
// A recording AnkiConnect stand-in: one deck and one Lapis-shaped note type.
|
||||
// Added notes (with later `updateNoteFields` writes) are echoed back by `notesInfo`
|
||||
// so the app can resolve their fields; scenarios still assert on `requests`.
|
||||
export async function startFakeAnki(): Promise<FakeAnki> {
|
||||
const requests: AnkiRequest[] = [];
|
||||
const addedNotes = new Map<number, Record<string, unknown>>();
|
||||
let nextNoteId = 1000;
|
||||
|
||||
const handle = (body: unknown): unknown => {
|
||||
@@ -59,10 +61,38 @@ export async function startFakeAnki(): Promise<FakeAnki> {
|
||||
return [FAKE_ANKI_MODEL];
|
||||
case 'modelFieldNames':
|
||||
return MODEL_FIELDS;
|
||||
case 'addNote':
|
||||
return nextNoteId++;
|
||||
case 'addNote': {
|
||||
const noteId = nextNoteId++;
|
||||
const note = isRecord(params.note) ? params.note : {};
|
||||
addedNotes.set(noteId, isRecord(note.fields) ? { ...note.fields } : {});
|
||||
return noteId;
|
||||
}
|
||||
case 'updateNoteFields': {
|
||||
const note = isRecord(params.note) ? params.note : {};
|
||||
const fields = typeof note.id === 'number' ? addedNotes.get(note.id) : undefined;
|
||||
if (fields && isRecord(note.fields)) Object.assign(fields, note.fields);
|
||||
return null;
|
||||
}
|
||||
case 'notesInfo': {
|
||||
// Like AnkiConnect: one entry per requested id, `{}` for unknown notes.
|
||||
const ids = Array.isArray(params.notes) ? params.notes : [];
|
||||
return ids.map((id) => {
|
||||
const fields = typeof id === 'number' ? addedNotes.get(id) : undefined;
|
||||
if (!fields) return {};
|
||||
return {
|
||||
noteId: id,
|
||||
modelName: FAKE_ANKI_MODEL,
|
||||
tags: [],
|
||||
fields: Object.fromEntries(
|
||||
MODEL_FIELDS.map((name, order) => [
|
||||
name,
|
||||
{ value: String(fields[name] ?? ''), order },
|
||||
]),
|
||||
),
|
||||
};
|
||||
});
|
||||
}
|
||||
case 'findNotes':
|
||||
case 'notesInfo':
|
||||
return [];
|
||||
case 'storeMediaFile':
|
||||
return params.filename ?? null;
|
||||
|
||||
+39
-4
@@ -15,25 +15,38 @@ export type MpvClient = {
|
||||
|
||||
type MpvReply = { request_id?: number; error?: string; data?: unknown };
|
||||
|
||||
function videoOutputArgs(display: E2eDisplay): string[] {
|
||||
// Xvfb has no GPU; the software X11 output always works there.
|
||||
if (display.kind === 'xvfb') return ['--vo=x11'];
|
||||
// gpu-next's Vulkan path (libplacebo over MoltenVK) segfaults on the first frame
|
||||
// on GitHub's paravirtual macOS GPU with libplacebo 7.387. `--vo=libmpv` is mpv's
|
||||
// cocoa-cb OpenGL output, which avoids it and still opens the window the overlay tracks.
|
||||
if (process.platform === 'darwin') return ['--vo=libmpv'];
|
||||
return [];
|
||||
}
|
||||
|
||||
export async function startMpv(options: {
|
||||
socketPath: string;
|
||||
mediaPath: string;
|
||||
subtitlePath: string;
|
||||
/** mpv's own verbose log (`--log-file`); `--no-terminal` silences its console output. */
|
||||
logPath: string;
|
||||
/** Process stdout/stderr, which still catches crash output from mpv's libraries. */
|
||||
stdioLogPath: string;
|
||||
display: E2eDisplay;
|
||||
}): Promise<ChildProcess> {
|
||||
const log = fs.openSync(options.logPath, 'w');
|
||||
const log = fs.openSync(options.stdioLogPath, 'w');
|
||||
const child = spawn(
|
||||
'mpv',
|
||||
[
|
||||
'--no-config',
|
||||
'--no-terminal',
|
||||
`--log-file=${options.logPath}`,
|
||||
'--pause',
|
||||
'--keep-open=yes',
|
||||
'--ao=null',
|
||||
`--geometry=${E2E_SCREEN.width}x${E2E_SCREEN.height}+0+0`,
|
||||
// Xvfb has no GPU; the software X11 output always works there.
|
||||
...(options.display.kind === 'xvfb' ? ['--vo=x11'] : []),
|
||||
...videoOutputArgs(options.display),
|
||||
`--input-ipc-server=${options.socketPath}`,
|
||||
`--sub-file=${options.subtitlePath}`,
|
||||
options.mediaPath,
|
||||
@@ -58,13 +71,31 @@ function tryConnect(socketPath: string): Promise<net.Socket | null> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function connectMpv(socketPath: string): Promise<MpvClient> {
|
||||
/**
|
||||
* Connects to mpv's JSON IPC socket. Once the socket closes (mpv exited or
|
||||
* crashed), pending and later commands reject instead of hanging until the test
|
||||
* timeout; `describeClose` adds context such as mpv's exit status.
|
||||
*/
|
||||
export async function connectMpv(
|
||||
socketPath: string,
|
||||
describeClose: () => string = () => 'mpv IPC connection closed',
|
||||
): Promise<MpvClient> {
|
||||
const socket = await waitUntil(() => tryConnect(socketPath), {
|
||||
description: `mpv IPC socket ${socketPath}`,
|
||||
});
|
||||
const pending = new Map<number, (reply: MpvReply) => void>();
|
||||
let nextRequestId = 1;
|
||||
let buffer = '';
|
||||
let closedError: Error | null = null;
|
||||
|
||||
const failPending = () => {
|
||||
closedError ??= new Error(describeClose());
|
||||
for (const settle of pending.values()) settle({ error: closedError.message });
|
||||
pending.clear();
|
||||
};
|
||||
socket.on('close', failPending);
|
||||
// 'close' always follows 'error'; listening here keeps the error from being thrown.
|
||||
socket.on('error', () => {});
|
||||
|
||||
socket.setEncoding('utf8');
|
||||
socket.on('data', (chunk: string) => {
|
||||
@@ -83,6 +114,10 @@ export async function connectMpv(socketPath: string): Promise<MpvClient> {
|
||||
return {
|
||||
command: (...args) =>
|
||||
new Promise((resolve, reject) => {
|
||||
if (closedError) {
|
||||
reject(new Error(`mpv ${JSON.stringify(args)} failed: ${closedError.message}`));
|
||||
return;
|
||||
}
|
||||
const requestId = nextRequestId++;
|
||||
pending.set(requestId, (reply) => {
|
||||
if (reply.error === 'success') resolve(reply.data);
|
||||
|
||||
+12
-2
@@ -265,15 +265,25 @@ export async function startE2eSession(options: E2eSessionOptions = {}): Promise<
|
||||
settings.close();
|
||||
await stopProcess(seeder.child);
|
||||
|
||||
const mpvLogPath = path.join(root, 'mpv.log');
|
||||
const mpvStdioLogPath = path.join(root, 'mpv-stdio.log');
|
||||
const mpvProcess = await startMpv({
|
||||
socketPath: mpvSocketPath,
|
||||
mediaPath,
|
||||
subtitlePath,
|
||||
logPath: path.join(root, 'mpv.log'),
|
||||
logPath: mpvLogPath,
|
||||
stdioLogPath: mpvStdioLogPath,
|
||||
display,
|
||||
});
|
||||
teardown.push(() => stopProcess(mpvProcess));
|
||||
const mpv = await connectMpv(mpvSocketPath);
|
||||
const mpv = await connectMpv(mpvSocketPath, () => {
|
||||
const { exitCode, signalCode } = mpvProcess;
|
||||
const status =
|
||||
exitCode === null && signalCode === null
|
||||
? 'mpv IPC connection closed'
|
||||
: `mpv exited (code ${String(exitCode)}, signal ${String(signalCode)})`;
|
||||
return `${status}; see ${mpvLogPath} and ${mpvStdioLogPath}`;
|
||||
});
|
||||
teardown.push(mpv.close);
|
||||
|
||||
const app = await launchApp(['--start']);
|
||||
|
||||
@@ -91,6 +91,14 @@ async function showCue(cue: (typeof FIXTURE_CUES)[number]): Promise<RenderedToke
|
||||
});
|
||||
}
|
||||
|
||||
// Card-kind flags are written before media, so wait for the update carrying audio.
|
||||
function findMediaUpdate(session: E2eSession) {
|
||||
return session.anki.requests.find(
|
||||
(request) =>
|
||||
request.action === 'updateNoteFields' && JSON.stringify(request.params).includes('[sound:'),
|
||||
);
|
||||
}
|
||||
|
||||
function hasToken(tokens: RenderedToken[], surface: string, headword: string): boolean {
|
||||
return tokens.some((token) => token.surface === surface && token.headword === headword);
|
||||
}
|
||||
@@ -126,10 +134,10 @@ test(
|
||||
session.anki.requests.length = 0;
|
||||
|
||||
await session.runAppCommand('--mine-sentence');
|
||||
const update = await waitUntil(
|
||||
() => session.anki.requests.find((request) => request.action === 'updateNoteFields'),
|
||||
{ description: 'media fields to be written to the mined note', timeoutMs: 30_000 },
|
||||
);
|
||||
const update = await waitUntil(() => findMediaUpdate(session), {
|
||||
description: 'media fields to be written to the mined note',
|
||||
timeoutMs: 30_000,
|
||||
});
|
||||
|
||||
const added = session.anki.requests.filter((request) => request.action === 'addNote');
|
||||
assert.equal(added.length, 1);
|
||||
@@ -156,6 +164,38 @@ test(
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'mining a line retimed with sub-delay clips it where mpv plays it',
|
||||
{ timeout: TEST_TIMEOUT_MS },
|
||||
async () => {
|
||||
const { session, overlay } = await useSession();
|
||||
const cue = FIXTURE_CUES[1];
|
||||
const delay = 2;
|
||||
await session.mpv.command('set_property', 'sub-delay', delay);
|
||||
try {
|
||||
// Past the cue's own end, so the line is only on screen because of the delay.
|
||||
await session.mpv.command('seek', cue.end + delay / 2, 'absolute+exact');
|
||||
await overlay.waitFor(
|
||||
`document.getElementById('subtitleRoot').textContent === ${JSON.stringify(cue.text)}`,
|
||||
{ description: 'overlay to show the delayed line' },
|
||||
);
|
||||
session.anki.requests.length = 0;
|
||||
|
||||
await session.runAppCommand('--mine-sentence');
|
||||
await waitUntil(() => findMediaUpdate(session), {
|
||||
description: 'media fields to be written to the mined note',
|
||||
timeoutMs: 30_000,
|
||||
});
|
||||
|
||||
// MiscInfo stamps the clip start: the cue's start on the video clock.
|
||||
const written = JSON.stringify(session.anki.requests);
|
||||
assert.ok(written.includes(`(00:00:0${cue.start + delay})`), written);
|
||||
} finally {
|
||||
await session.mpv.command('set_property', 'sub-delay', 0);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'open subtitle sidebar lists the parsed cues and follows playback',
|
||||
{ timeout: TEST_TIMEOUT_MS },
|
||||
@@ -184,6 +224,49 @@ test(
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'subtitle sidebar follows and seeks a sub-delay retimed track',
|
||||
{ timeout: TEST_TIMEOUT_MS },
|
||||
async () => {
|
||||
const { session, overlay } = await useSession();
|
||||
const delay = 2;
|
||||
await session.mpv.command('set_property', 'sub-delay', delay);
|
||||
try {
|
||||
// At 9s cue 2 starts on the file's clock, but mpv is still showing cue 1.
|
||||
await session.mpv.command('seek', FIXTURE_CUES[2].start, 'absolute+exact');
|
||||
await overlay.waitFor(
|
||||
`document.getElementById('subtitleRoot').textContent === ${JSON.stringify(FIXTURE_CUES[1].text)}`,
|
||||
{ description: 'overlay to show the delayed line' },
|
||||
);
|
||||
await session.runAppCommand('--toggle-subtitle-sidebar');
|
||||
await overlay.waitFor(
|
||||
`document.querySelector('#subtitleSidebarList .subtitle-sidebar-item.active')?.dataset.index === '1'`,
|
||||
{ description: 'sidebar to highlight the delayed line' },
|
||||
);
|
||||
|
||||
await overlay.evaluate(
|
||||
`document.querySelector('#subtitleSidebarList .subtitle-sidebar-item[data-index="2"]').click()`,
|
||||
);
|
||||
const target = FIXTURE_CUES[2].start + delay;
|
||||
await waitUntil(
|
||||
async () => {
|
||||
const time = Number(await session.mpv.command('get_property', 'time-pos'));
|
||||
return time >= target && time < target + 0.5;
|
||||
},
|
||||
{ description: `click to seek to cue 2 at ${target}s on the video clock` },
|
||||
);
|
||||
|
||||
await session.runAppCommand('--toggle-subtitle-sidebar');
|
||||
await overlay.waitFor(
|
||||
`document.getElementById('subtitleSidebarModal').classList.contains('hidden')`,
|
||||
{ description: 'sidebar to close' },
|
||||
);
|
||||
} finally {
|
||||
await session.mpv.command('set_property', 'sub-delay', 0);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Runs last: it leaves the lookup popup open over the overlay.
|
||||
test(
|
||||
'holding Shift over a word opens the Yomitan popup with its dictionary entry',
|
||||
|
||||
+22
-24
@@ -172,32 +172,30 @@ test('runAppCommandCaptureOutput strips ELECTRON_RUN_AS_NODE from app child env'
|
||||
});
|
||||
});
|
||||
|
||||
test(
|
||||
'runAppCommandCaptureOutput transports Linux AppImage args through environment',
|
||||
{ skip: process.platform !== 'linux' },
|
||||
async () => {
|
||||
await withTempCase(({ dir }) => {
|
||||
const appPath = writeFakeApp(
|
||||
dir,
|
||||
[
|
||||
'printf "args:%s\\n" "$*"',
|
||||
'printf "argc:%s\\n" "$SUBMINER_APP_ARGC"',
|
||||
'printf "arg0:%s\\n" "$SUBMINER_APP_ARG_0"',
|
||||
'printf "arg1:%s\\n" "$SUBMINER_APP_ARG_1"',
|
||||
],
|
||||
'SubMiner.AppImage',
|
||||
);
|
||||
test('runAppCommandCaptureOutput transports Linux AppImage args through environment', async () => {
|
||||
// Bun's node:test shim ignores the `skip` option, so gate the platform here.
|
||||
if (process.platform !== 'linux') return;
|
||||
await withTempCase(({ dir }) => {
|
||||
const appPath = writeFakeApp(
|
||||
dir,
|
||||
[
|
||||
'printf "args:%s\\n" "$*"',
|
||||
'printf "argc:%s\\n" "$SUBMINER_APP_ARGC"',
|
||||
'printf "arg0:%s\\n" "$SUBMINER_APP_ARG_0"',
|
||||
'printf "arg1:%s\\n" "$SUBMINER_APP_ARG_1"',
|
||||
],
|
||||
'SubMiner.AppImage',
|
||||
);
|
||||
|
||||
const result = runAppCommandCaptureOutput(appPath, ['--app-ping', '--socket']);
|
||||
const result = runAppCommandCaptureOutput(appPath, ['--app-ping', '--socket']);
|
||||
|
||||
assert.equal(result.status, 0);
|
||||
assert.match(result.stdout, /^args:\n/m);
|
||||
assert.match(result.stdout, /^argc:2\n/m);
|
||||
assert.match(result.stdout, /^arg0:--app-ping\n/m);
|
||||
assert.match(result.stdout, /^arg1:--socket\n/m);
|
||||
});
|
||||
},
|
||||
);
|
||||
assert.equal(result.status, 0);
|
||||
assert.match(result.stdout, /^args:\n/m);
|
||||
assert.match(result.stdout, /^argc:2\n/m);
|
||||
assert.match(result.stdout, /^arg0:--app-ping\n/m);
|
||||
assert.match(result.stdout, /^arg1:--socket\n/m);
|
||||
});
|
||||
});
|
||||
|
||||
test('runAppCommandCaptureOutput runs Linux AppImage sync in Node-only mode', async () => {
|
||||
await withTempCase(({ dir }) => {
|
||||
|
||||
+15
-8
@@ -2,7 +2,7 @@
|
||||
"name": "subminer",
|
||||
"productName": "SubMiner",
|
||||
"desktopName": "SubMiner.desktop",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"description": "All-in-one sentence mining overlay with AnkiConnect and dictionary integration",
|
||||
"packageManager": "bun@1.3.5",
|
||||
"main": "dist/main-entry.js",
|
||||
@@ -93,7 +93,7 @@
|
||||
"brace-expansion": "5.0.11",
|
||||
"electron-builder-squirrel-windows": "26.16.1",
|
||||
"fast-uri": "3.1.7",
|
||||
"follow-redirects": "1.16.1",
|
||||
"follow-redirects": "1.16.2",
|
||||
"form-data": "4.0.6",
|
||||
"ip-address": "10.2.0",
|
||||
"js-yaml": "4.3.2",
|
||||
@@ -146,7 +146,8 @@
|
||||
"afterPack": "scripts/electron-builder-after-pack.cjs",
|
||||
"icon": "assets/SubMiner-square.png",
|
||||
"directories": {
|
||||
"output": "release"
|
||||
"buildResources": "packaging/electron-builder",
|
||||
"output": "dist/release"
|
||||
},
|
||||
"publish": [
|
||||
{
|
||||
@@ -178,8 +179,8 @@
|
||||
"category": "public.app-category.video",
|
||||
"icon": "assets/SubMiner-square.png",
|
||||
"hardenedRuntime": true,
|
||||
"entitlements": "build/entitlements.mac.plist",
|
||||
"entitlementsInherit": "build/entitlements.mac.plist",
|
||||
"entitlements": "packaging/electron-builder/entitlements.mac.plist",
|
||||
"entitlementsInherit": "packaging/electron-builder/entitlements.mac.plist",
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "dist/scripts/get-mpv-window-macos",
|
||||
@@ -211,7 +212,7 @@
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"include": "build/installer.nsh"
|
||||
"include": "packaging/electron-builder/installer.nsh"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
@@ -225,17 +226,18 @@
|
||||
"!**/{test,tests,__tests__,fixture,fixtures,__fixtures__}{,/**/*}",
|
||||
"!dist/launcher{,/**/*}",
|
||||
"!dist/scripts{,/**/*}",
|
||||
"!dist/{yomitan,hachidori,release}{,/**/*}",
|
||||
"!dist/{renderer,settings,syncui}/fonts{,/**/*}",
|
||||
"!node_modules/koffi/{src,vendor,doc}{,/**/*}",
|
||||
"!node_modules/@libsql/linux-x64-musl{,/**/*}"
|
||||
],
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "build/yomitan",
|
||||
"from": "dist/yomitan",
|
||||
"to": "yomitan"
|
||||
},
|
||||
{
|
||||
"from": "build/hachidori",
|
||||
"from": "dist/hachidori",
|
||||
"to": "hachidori"
|
||||
},
|
||||
{
|
||||
@@ -277,6 +279,11 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 100,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"@discordjs/rest@2.6.1": "patches/@discordjs%2Frest@2.6.1.patch"
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
}
|
||||
},
|
||||
"licenseInventoryStatus": "source-and-notices-pinned-to-binary-revision",
|
||||
"sourceManifest": "build/bun-source-manifest.json",
|
||||
"sourceManifest": "packaging/bun/bun-source-manifest.json",
|
||||
"correspondingSourceAsset": "bun-v1.3.5-source.tar.gz"
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,7 @@ The SubMiner GitHub release containing this application also contains `bun-v1.3.
|
||||
- every external source repository registered by that Bun revision's CMake build, at its exact commit
|
||||
- Bun's dependency patches, build scripts, lockfiles, collected third-party license files, and instructions for rebuilding Bun against a modified JavaScriptCore
|
||||
|
||||
The machine-readable inventory lives at `SOURCE-INVENTORY.json` inside the source archive and at `build/bun-source-manifest.json` in SubMiner's source repository.
|
||||
The machine-readable inventory lives at `SOURCE-INVENTORY.json` inside the source archive and at `packaging/bun/bun-source-manifest.json` in SubMiner's source repository.
|
||||
|
||||
The archive vendors the source repositories linked through Bun's CMake build. It preserves Bun's package-manager lockfiles and lol-html's `Cargo.lock`, but it does not vendor npm packages, crates.io packages, compilers, SDKs, or other build tools. Rebuilding needs network access for those package-manager and toolchain inputs. The archive's rebuild README records the known tool versions and the remaining unpinned Rust nightly input.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Bun 1.3.5 third-party notices
|
||||
|
||||
This file collects the license texts shipped by the external source repositories used by Bun 1.3.5 at the revisions in build/bun-source-manifest.json. The corresponding-source release asset also preserves license notices embedded in individual Bun and WebKit source files. Bun’s own LICENSE.md lists additional embedded libraries and JavaScript polyfills whose source and per-file notices are included in that asset.
|
||||
This file collects the license texts shipped by the external source repositories used by Bun 1.3.5 at the revisions in packaging/bun/bun-source-manifest.json. The corresponding-source release asset also preserves license notices embedded in individual Bun and WebKit source files. Bun’s own LICENSE.md lists additional embedded libraries and JavaScript polyfills whose source and per-file notices are included in that asset.
|
||||
|
||||
## BoringSSL
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,32 @@
|
||||
## Highlights
|
||||
### Changed
|
||||
- **Stats Session View**: The expanded session view in the stats dashboard has been redesigned. It shows stat tiles for pace, lines, known-word rate, lookups, and paused time, plus a reading density chart of known and unknown words with lookup and card-mined markers.
|
||||
|
||||
### Fixed
|
||||
- **Subtitle Delay**: Retiming subtitles in mpv (z/x or sub-step) now carries through SubMiner. Mined card audio, images, and timestamps match the retimed line, and so do the subtitle sidebar, subtitle navigation, and replay.
|
||||
- **Subtitle Sidebar**: mpv keys and mouse buttons, such as volume keys and double-click fullscreen, work again while the sidebar is open.
|
||||
|
||||
### Docs
|
||||
- **README**: Refreshed the anime screenshots using the current build.
|
||||
|
||||
## What's Changed
|
||||
|
||||
- fix(overlay): forward mpv input while subtitle sidebar is open by @ksyasuda in #300
|
||||
- fix(subtitles): follow mpv sub-delay in mining, sidebar, and navigation by @ksyasuda in #302
|
||||
- feat(stats): redesign expanded session view with density chart by @ksyasuda in #304
|
||||
|
||||
## Installation
|
||||
|
||||
See the README and docs/installation guide for full setup steps.
|
||||
|
||||
## Assets
|
||||
|
||||
- Linux: `SubMiner.AppImage`
|
||||
- macOS: `SubMiner-*.dmg` and `SubMiner-*.zip`
|
||||
- Windows: `SubMiner-*.exe` and `SubMiner-*-win.zip`
|
||||
- Optional extras: `subminer-assets.tar.gz`, the `subminer` launcher, and the Windows `subminer.cmd` launcher
|
||||
- Bun corresponding source: `bun-v1.3.5-source.tar.gz` and its `.sha256` file
|
||||
|
||||
Both launcher downloads use Bun included with the SubMiner app. Download `subminer` on Linux or macOS and `subminer.cmd` on Windows.
|
||||
|
||||
The app bundles an unmodified Bun 1.3.5 runtime. Bun is MIT licensed and statically links JavaScriptCore (LGPL 2.0) and TinyCC (LGPL 2.1). License texts and third-party notices ship inside the app under `resources/bun/licenses`, and the source archive above contains the matching Bun, WebKit, and dependency sources for relinking.
|
||||
@@ -1,60 +0,0 @@
|
||||
## Highlights
|
||||
### Added
|
||||
- **Hachidori Dictionary Backend**: Bundled Hachidori backend as an alternative to Yomitan. Select it with `dictionaryBackend` and restart SubMiner.
|
||||
- Works with subtitle scanning, popups, frequency highlighting, character dictionaries, Anki mining, and stats dashboard mining.
|
||||
- First-run setup builds Hachidori's Anki template from your existing SubMiner deck, tags, and field mappings.
|
||||
- Can link an external Hachidori app, browser, or Docker host while Anki mining stays in SubMiner.
|
||||
- The tray and dictionary-settings shortcut open the selected backend's settings. `--hachidori` and `--yomitan` open a specific one.
|
||||
- **Jellyfin Subtitle Generation**: Japanese subtitle generation now works while playing Jellyfin episodes, with both direct-play and transcoded playback.
|
||||
|
||||
### Fixed
|
||||
- **Media Timing Review**: Opens on the first try and keeps playback paused while open, even when a dictionary popup closes.
|
||||
- **Jellyfin Terminal Playback**:
|
||||
- `subminer jellyfin -p` lists libraries when SubMiner is already running, and picker image previews work again.
|
||||
- Real errors, like an expired session or an unreachable server, now appear instead of an empty list.
|
||||
- Watch progress and played status reach Jellyfin even when cast discovery is off.
|
||||
- When it starts SubMiner itself, SubMiner now shows a tray icon and quits when mpv closes.
|
||||
- The rofi search step is now a compact input box.
|
||||
- **macOS Casting**: Jellyfin casting finds mpv when SubMiner is opened from Finder, the Dock, or Spotlight. `mpv.executablePath` and `SUBMINER_MPV_PATH` are now honored on macOS and Linux.
|
||||
- **macOS Launcher PATH**: The command-line launcher no longer shows "Not on PATH" when SubMiner is opened from Finder or the Dock.
|
||||
- **Keyboard-Only Mode**: `h`, `l`, and the arrow keys type normally in modals and text fields instead of seeking mpv. Toggling the mode inside a modal no longer turns on a hidden keyboard-only mode.
|
||||
- **Halfwidth Katakana**: Halfwidth katakana in subtitles now displays as fullwidth, including in mined cards and the stats dashboard. Stats sentence search matches katakana in either width.
|
||||
- **Subtitle Annotations**: Lines shown while two cues overlap now get annotations right away. Prefetching no longer restarts during startup.
|
||||
- **Subtitle Sidebar**: The open sidebar does far less work during playback.
|
||||
- **Hyprland and Sway**: A slow or hung `hyprctl` or `swaymsg` no longer freezes the app.
|
||||
- **Stats Mining**: Cards mined from the stats dashboard keep the selected history line and media.
|
||||
- **Security Updates**: Updated Electron, undici, and follow-redirects to fix new security advisories.
|
||||
|
||||
### Docs
|
||||
- **Hachidori Setup**: Covers backend selection, Hachidori dictionary and Anki setup, settings flags and shortcuts, and linking an external host.
|
||||
- **Jellyfin**: The docs now say SubMiner joins the cast menu at startup only when both `startupWarmups.jellyfinRemoteSession` and `jellyfin.remoteControlAutoConnect` are on. Otherwise, enable **Jellyfin Discovery** in the tray.
|
||||
- **Casting and mpv**: Added how casting finds mpv on each platform, a troubleshooting entry for casts that never start mpv, and a note on the macOS 27 Accessibility list rename.
|
||||
- **Jimaku Environment Variables**: Removed the unused `SUBMINER_JIMAKU_*` variables from the docs. Set the key with `jimaku.apiKey` or `jimaku.apiKeyCommand` instead.
|
||||
|
||||
## What's Changed
|
||||
|
||||
- feat(dictionary): add Hachidori backend support by @ksyasuda in #266
|
||||
- fix(jellyfin): make terminal play work with a running app and report progress by @ksyasuda in #288
|
||||
- fix(overlay): stop Hyprland/Sway tracker polls from blocking the main thread by @ksyasuda in #289
|
||||
- fix(overlay): poll cheap playback state in the open subtitle sidebar by @ksyasuda in #290
|
||||
- fix(overlay): keep keyboard mode from swallowing modal and text-field keys by @ksyasuda in #291
|
||||
- refactor: remove dead code and enable noUnusedLocals by @ksyasuda in #292
|
||||
- feat(subtitles): generate Japanese subtitles during Jellyfin playback by @ksyasuda in #294
|
||||
- fix(subtitles): widen halfwidth katakana where subtitle text enters the app by @ksyasuda in #295
|
||||
- fix(jellyfin): find mpv when SubMiner is launched from Finder by @ksyasuda in #298
|
||||
|
||||
## Installation
|
||||
|
||||
See the README and docs/installation guide for full setup steps.
|
||||
|
||||
## Assets
|
||||
|
||||
- Linux: `SubMiner.AppImage`
|
||||
- macOS: `SubMiner-*.dmg` and `SubMiner-*.zip`
|
||||
- Windows: `SubMiner-*.exe` and `SubMiner-*-win.zip`
|
||||
- Optional extras: `subminer-assets.tar.gz`, the `subminer` launcher, and the Windows `subminer.cmd` launcher
|
||||
- Bun corresponding source: `bun-v1.3.5-source.tar.gz` and its `.sha256` file
|
||||
|
||||
Both launcher downloads use Bun included with the SubMiner app. Download `subminer` on Linux or macOS and `subminer.cmd` on Windows.
|
||||
|
||||
The app bundles an unmodified Bun 1.3.5 runtime. Bun is MIT licensed and statically links JavaScriptCore (LGPL 2.0) and TinyCC (LGPL 2.1). License texts and third-party notices ship inside the app under `resources/bun/licenses`, and the source archive above contains the matching Bun, WebKit, and dependency sources for relinking.
|
||||
@@ -29,6 +29,10 @@ test.each([false, true])(
|
||||
port: 0,
|
||||
fetch(request) {
|
||||
const pathname = new URL(request.url).pathname;
|
||||
// Ignore stray local probes of the ephemeral port; only count the script's downloads.
|
||||
if (!pathname.startsWith('/ksyasuda/SubMiner/releases/download/')) {
|
||||
return new Response('not found', { status: 404 });
|
||||
}
|
||||
requests.push(pathname);
|
||||
if (unavailable || requests.length === 1) return new Response('try again', { status: 503 });
|
||||
const name = pathname.split('/').at(-1);
|
||||
|
||||
@@ -203,7 +203,7 @@ test('writeChangelogArtifacts ignores README, groups fragments by type, writes r
|
||||
assert.match(changelog, /### Fixed\n- Polished: fixed entry\./);
|
||||
assert.match(changelog, /## v0\.4\.0 \(2026-03-01\)\n- Existing fix\n$/);
|
||||
|
||||
const releaseNotes = project.read('release/release-notes.md');
|
||||
const releaseNotes = project.read('packaging/release-notes/release-notes.md');
|
||||
assert.match(releaseNotes, /## Highlights\n### Added\n- Polished: added entry\./);
|
||||
assert.match(releaseNotes, /### Fixed\n- Polished: fixed entry\./);
|
||||
assert.match(releaseNotes, /## Installation\n\nSee the README and docs\/installation guide/);
|
||||
@@ -240,7 +240,7 @@ test('writeChangelogArtifacts skips changelog prepend when release section alrea
|
||||
assert.equal(project.exists('changes/001.md'), false);
|
||||
assert.equal(project.read('CHANGELOG.md'), existingChangelog);
|
||||
assert.match(
|
||||
project.read('release/release-notes.md'),
|
||||
project.read('packaging/release-notes/release-notes.md'),
|
||||
/## Highlights\n### Added\n- Existing release bullet\./,
|
||||
);
|
||||
},
|
||||
@@ -268,7 +268,7 @@ test('writeStableReleaseArtifacts reuses the requested version and date for chan
|
||||
});
|
||||
|
||||
assert.deepEqual(result.outputPaths, [project.at('CHANGELOG.md')]);
|
||||
assert.equal(result.releaseNotesPath, project.at('release/release-notes.md'));
|
||||
assert.equal(result.releaseNotesPath, project.at('packaging/release-notes/release-notes.md'));
|
||||
assert.equal(result.docsChangelogPath, project.at('docs-site/changelog.md'));
|
||||
|
||||
assert.match(project.read('CHANGELOG.md'), /## v0\.4\.1 \(2026-03-07\)/);
|
||||
@@ -471,7 +471,7 @@ test('writePrereleaseNotesForVersion writes cumulative beta notes without mutati
|
||||
deps: { runClaude: stub.runClaude, listPrereleaseTags: () => [] },
|
||||
});
|
||||
|
||||
assert.equal(outputPath, project.at('release/prerelease-notes.md'));
|
||||
assert.equal(outputPath, project.at('packaging/release-notes/prerelease-notes.md'));
|
||||
assert.equal(
|
||||
project.read('CHANGELOG.md'),
|
||||
existingChangelog,
|
||||
@@ -527,7 +527,7 @@ test('writePrereleaseNotesForVersion reuses existing prerelease notes when addin
|
||||
'prerelease-reuse-existing-notes',
|
||||
{
|
||||
'package.json': packageJson('0.11.3-beta.2'),
|
||||
'release/prerelease-notes.md': existingNotes,
|
||||
'packaging/release-notes/prerelease-notes.md': existingNotes,
|
||||
'changes/001.md': fragment('fixed', 'launcher', '- Fixed launcher prerelease packaging.'),
|
||||
},
|
||||
(project) => {
|
||||
@@ -574,7 +574,7 @@ test('writePrereleaseNotesForVersion ignores unmarked prerelease notes from an o
|
||||
'prerelease-ignore-unmarked-old-notes',
|
||||
{
|
||||
'package.json': packageJson('0.17.0-beta.1'),
|
||||
'release/prerelease-notes.md': existingNotes,
|
||||
'packaging/release-notes/prerelease-notes.md': existingNotes,
|
||||
'changes/001.md': fragment(
|
||||
'changed',
|
||||
'overlay',
|
||||
@@ -785,7 +785,7 @@ test('writeChangelogArtifacts filters internal fragments from the release-notes
|
||||
'release-notes mode drops internal fragments',
|
||||
);
|
||||
|
||||
const releaseNotes = project.read('release/release-notes.md');
|
||||
const releaseNotes = project.read('packaging/release-notes/release-notes.md');
|
||||
assert.doesNotMatch(releaseNotes, /<details>/);
|
||||
assert.doesNotMatch(releaseNotes, /### Internal/);
|
||||
assert.match(
|
||||
@@ -841,7 +841,7 @@ test('writeChangelogArtifacts appends contributor attribution and a new-contribu
|
||||
project.at('changes/002.md'),
|
||||
]);
|
||||
|
||||
const releaseNotes = project.read('release/release-notes.md');
|
||||
const releaseNotes = project.read('packaging/release-notes/release-notes.md');
|
||||
assert.match(releaseNotes, /## What's Changed\n\n/);
|
||||
assert.match(releaseNotes, /- feat\(overlay\): add a feature by @ksyasuda in #110\n/);
|
||||
assert.match(releaseNotes, /- fix\(jellyfin\): restart remote session by @bee-san in #112\n/);
|
||||
@@ -904,7 +904,10 @@ test('writeChangelogArtifacts skips contributor attribution in GitHub Actions wi
|
||||
});
|
||||
|
||||
assert.deepEqual(warnings, []);
|
||||
assert.doesNotMatch(project.read('release/release-notes.md'), /## What's Changed/);
|
||||
assert.doesNotMatch(
|
||||
project.read('packaging/release-notes/release-notes.md'),
|
||||
/## What's Changed/,
|
||||
);
|
||||
} finally {
|
||||
console.warn = originalWarn;
|
||||
for (const key of envKeys) {
|
||||
@@ -990,7 +993,10 @@ test('writeReleaseNotesForVersion preserves committed contributor attribution be
|
||||
|
||||
await withProject(
|
||||
'release-notes-preserve-attribution',
|
||||
{ 'CHANGELOG.md': existingChangelog, 'release/release-notes.md': committedReleaseNotes },
|
||||
{
|
||||
'CHANGELOG.md': existingChangelog,
|
||||
'packaging/release-notes/release-notes.md': committedReleaseNotes,
|
||||
},
|
||||
(project) => {
|
||||
const outputPath = writeReleaseNotesForVersion({
|
||||
cwd: project.projectRoot,
|
||||
@@ -1055,7 +1061,7 @@ test('writeChangelogArtifacts strips <details> blocks from release notes when re
|
||||
'no Claude calls should fire when the section already exists',
|
||||
);
|
||||
|
||||
const releaseNotes = project.read('release/release-notes.md');
|
||||
const releaseNotes = project.read('packaging/release-notes/release-notes.md');
|
||||
assert.match(releaseNotes, /## Highlights\n### Added\n- Polished: previously committed\./);
|
||||
assert.doesNotMatch(releaseNotes, /<details>/);
|
||||
assert.doesNotMatch(releaseNotes, /### Internal/);
|
||||
@@ -1237,7 +1243,7 @@ test('writePrereleaseNotesForVersion strips the stale delta section from the reu
|
||||
'prerelease-reuse-strips-delta',
|
||||
{
|
||||
'package.json': packageJson('0.12.0-beta.3'),
|
||||
'release/prerelease-notes.md': existingNotes,
|
||||
'packaging/release-notes/prerelease-notes.md': existingNotes,
|
||||
'changes/001.md': fragment('added', 'overlay', '- Added overlay coverage.'),
|
||||
},
|
||||
(project) => {
|
||||
@@ -1271,7 +1277,7 @@ test('verifyPrereleaseNotesMatchVersion accepts matching notes and rejects stale
|
||||
(project) => {
|
||||
const verify = (version = '0.12.0-beta.2') =>
|
||||
verifyPrereleaseNotesMatchVersion({ cwd: project.projectRoot, version });
|
||||
const notesPath = 'release/prerelease-notes.md';
|
||||
const notesPath = 'packaging/release-notes/prerelease-notes.md';
|
||||
|
||||
assert.throws(() => verify(), /Missing .*prerelease-notes\.md/);
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ type PullRequestChangelogOptions = {
|
||||
changedLabels?: string[];
|
||||
};
|
||||
|
||||
const RELEASE_NOTES_PATH = path.join('release', 'release-notes.md');
|
||||
const PRERELEASE_NOTES_PATH = path.join('release', 'prerelease-notes.md');
|
||||
const RELEASE_NOTES_PATH = path.join('packaging', 'release-notes', 'release-notes.md');
|
||||
const PRERELEASE_NOTES_PATH = path.join('packaging', 'release-notes', 'prerelease-notes.md');
|
||||
const CHANGELOG_HEADER = '# Changelog';
|
||||
const CHANGE_TYPES: FragmentType[] = ['added', 'changed', 'fixed', 'docs', 'internal'];
|
||||
const SKIP_CHANGELOG_LABEL = 'skip-changelog';
|
||||
@@ -1144,7 +1144,7 @@ function isFragmentPath(candidate: string): boolean {
|
||||
function isIgnoredPullRequestPath(candidate: string): boolean {
|
||||
return (
|
||||
candidate === 'CHANGELOG.md' ||
|
||||
candidate === 'release/release-notes.md' ||
|
||||
candidate === 'packaging/release-notes/release-notes.md' ||
|
||||
candidate === 'AGENTS.md' ||
|
||||
candidate === 'README.md' ||
|
||||
candidate.startsWith('changes/') ||
|
||||
@@ -1405,7 +1405,7 @@ export function verifyPrereleaseNotesMatchVersion(options?: ChangelogOptions): v
|
||||
const markerVersion = extractPrereleaseVersionMarker(readFileSync(prereleaseNotesPath, 'utf8'));
|
||||
if (markerVersion !== version) {
|
||||
throw new Error(
|
||||
`release/prerelease-notes.md was generated for ${markerVersion ?? 'an unknown version (missing or legacy prerelease-version marker)'} but this release is ${version}. Rerun 'bun run changelog:prerelease-notes --version ${version}' and commit the result.`,
|
||||
`packaging/release-notes/prerelease-notes.md was generated for ${markerVersion ?? 'an unknown version (missing or legacy prerelease-version marker)'} but this release is ${version}. Rerun 'bun run changelog:prerelease-notes --version ${version}' and commit the result.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
|
||||
|
||||
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const source = path.join(repoRoot, 'vendor', 'hachidori');
|
||||
const output = path.join(repoRoot, 'build', 'hachidori');
|
||||
const output = path.join(repoRoot, 'dist', 'hachidori');
|
||||
const provenance = JSON.parse(fs.readFileSync(path.join(source, 'SOURCE.json'), 'utf8'));
|
||||
|
||||
// Upstream commits the engine binaries. Verify the pinned bytes before staging
|
||||
|
||||
@@ -19,7 +19,7 @@ test('Hachidori staging configures Electron without changing the fork source', a
|
||||
files.map((file) => readFileSync(source(file), 'utf8')),
|
||||
before,
|
||||
);
|
||||
const staged = await import(new URL('../build/hachidori/overlay-mode.js', import.meta.url).href);
|
||||
const staged = await import(new URL('../dist/hachidori/overlay-mode.js', import.meta.url).href);
|
||||
assert.equal(staged.OVERLAY_MODE, true);
|
||||
assert.equal(staged.HOST_CAPABILITIES.customJavaScript, false);
|
||||
const original = await import(source('overlay-mode.js').href);
|
||||
@@ -28,13 +28,13 @@ test('Hachidori staging configures Electron without changing the fork source', a
|
||||
// SubMiner mines media from mpv, not the overlay viewport, so the lookup
|
||||
// highlight stays on for a first install.
|
||||
const stagedSetup = await import(
|
||||
new URL('../build/hachidori/setup-state.js', import.meta.url).href
|
||||
new URL('../dist/hachidori/setup-state.js', import.meta.url).href
|
||||
);
|
||||
assert.equal(stagedSetup.OVERLAY_MODE_OPTIONS.sourceHighlightEnabled, true);
|
||||
const originalSetup = await import(source('setup-state.js').href);
|
||||
assert.equal(originalSetup.OVERLAY_MODE_OPTIONS.sourceHighlightEnabled, false);
|
||||
const manifest = JSON.parse(
|
||||
readFileSync(new URL('../build/hachidori/manifest.json', import.meta.url), 'utf8'),
|
||||
readFileSync(new URL('../dist/hachidori/manifest.json', import.meta.url), 'utf8'),
|
||||
);
|
||||
const originalManifest = JSON.parse(readFileSync(source('manifest.json'), 'utf8'));
|
||||
assert.deepEqual(manifest, {
|
||||
|
||||
@@ -10,7 +10,7 @@ const repoRoot = path.resolve(dirname, '..');
|
||||
const submoduleDir = path.join(repoRoot, 'vendor', 'subminer-yomitan');
|
||||
const submodulePackagePath = path.join(submoduleDir, 'package.json');
|
||||
const submodulePackageLockPath = path.join(submoduleDir, 'package-lock.json');
|
||||
const buildOutputDir = path.join(repoRoot, 'build', 'yomitan');
|
||||
const buildOutputDir = path.join(repoRoot, 'dist', 'yomitan');
|
||||
const stampPath = path.join(buildOutputDir, '.subminer-build.json');
|
||||
const zipPath = path.join(submoduleDir, 'builds', 'yomitan-chrome.zip');
|
||||
const bunCommand = process.versions.bun ? process.execPath : 'bun';
|
||||
|
||||
@@ -48,7 +48,7 @@ app
|
||||
.then(async () => {
|
||||
const targetSession = session.fromPartition('persist:hachidori-check');
|
||||
const extension = await targetSession.extensions.loadExtension(
|
||||
path.join(root, 'build/hachidori'),
|
||||
path.join(root, 'dist/hachidori'),
|
||||
{ allowFileAccess: true },
|
||||
);
|
||||
// Keep a host window alive while the dictionary importer opens/closes its
|
||||
|
||||
@@ -18,7 +18,7 @@ test('platform packaging preserves the runtime allowlist after builder normalize
|
||||
'/tmp/subminer-filter-output',
|
||||
{
|
||||
defaultSrc: root,
|
||||
globalOutDir: path.join(root, 'release'),
|
||||
globalOutDir: path.join(root, 'dist', 'release'),
|
||||
customBuildOptions: { files: config.build[platform].files },
|
||||
macroExpander: (value) => value.replaceAll('${arch}', 'x64'),
|
||||
},
|
||||
@@ -51,6 +51,9 @@ test('platform packaging preserves the runtime allowlist after builder normalize
|
||||
'stats/dist/nested/fixtures/data.json',
|
||||
'vendor/texthooker-ui/docs/nested/component.tsx',
|
||||
'dist/launcher/subminer',
|
||||
'dist/yomitan/manifest.json',
|
||||
'dist/hachidori/manifest.json',
|
||||
'dist/release/SubMiner-1.0.0.AppImage',
|
||||
'dist/settings/fonts/MPLUS1[wght].ttf',
|
||||
'vendor/subminer-yomitan/ext/manifest.json',
|
||||
]) {
|
||||
|
||||
@@ -10,14 +10,20 @@ import { Readable } from 'node:stream';
|
||||
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = path.resolve(scriptDir, '..');
|
||||
|
||||
export const DEFAULT_MANIFEST_PATH = path.join(repoRoot, 'build', 'bun-source-manifest.json');
|
||||
export const DEFAULT_MANIFEST_PATH = path.join(
|
||||
repoRoot,
|
||||
'packaging',
|
||||
'bun',
|
||||
'bun-source-manifest.json',
|
||||
);
|
||||
export const DEFAULT_RUNTIME_MANIFEST_PATH = path.join(
|
||||
repoRoot,
|
||||
'build',
|
||||
'packaging',
|
||||
'bun',
|
||||
'bun-runtime-manifest.json',
|
||||
);
|
||||
export const DEFAULT_PACKAGE_JSON_PATH = path.join(repoRoot, 'package.json');
|
||||
export const DEFAULT_OUTPUT_DIR = path.join(repoRoot, 'release');
|
||||
export const DEFAULT_OUTPUT_DIR = path.join(repoRoot, 'dist', 'release');
|
||||
export const DEFAULT_CACHE_DIR = path.join(repoRoot, '.tmp', 'bun-corresponding-source');
|
||||
|
||||
function isRecord(value) {
|
||||
|
||||
@@ -4,6 +4,9 @@ import fs from 'node:fs/promises';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import {
|
||||
DEFAULT_MANIFEST_PATH,
|
||||
DEFAULT_PACKAGE_JSON_PATH,
|
||||
DEFAULT_RUNTIME_MANIFEST_PATH,
|
||||
downloadArchive,
|
||||
parseRegisteredRepositories,
|
||||
parseSourceManifest,
|
||||
@@ -67,10 +70,26 @@ describe('Bun corresponding-source manifest', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('default manifest paths resolve to aligned checked-in manifests', async () => {
|
||||
const [manifestText, runtimeManifestText, packageJsonText] = await Promise.all([
|
||||
fs.readFile(DEFAULT_MANIFEST_PATH, 'utf8'),
|
||||
fs.readFile(DEFAULT_RUNTIME_MANIFEST_PATH, 'utf8'),
|
||||
fs.readFile(DEFAULT_PACKAGE_JSON_PATH, 'utf8'),
|
||||
]);
|
||||
|
||||
expect(() =>
|
||||
validateRuntimeAlignment(
|
||||
parseSourceManifest(JSON.parse(manifestText)),
|
||||
JSON.parse(packageJsonText),
|
||||
JSON.parse(runtimeManifestText),
|
||||
),
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
test('rejects stale runtime or package-manager pins', async () => {
|
||||
const manifest = parseSourceManifest(
|
||||
JSON.parse(
|
||||
await fs.readFile(path.join(projectRoot, 'build/bun-source-manifest.json'), 'utf8'),
|
||||
await fs.readFile(path.join(projectRoot, 'packaging/bun/bun-source-manifest.json'), 'utf8'),
|
||||
),
|
||||
);
|
||||
const runtimeManifest = {
|
||||
@@ -100,7 +119,7 @@ describe('Bun corresponding-source manifest', () => {
|
||||
test('rejects drift in CMake dependency and WebKit pins', async () => {
|
||||
const manifest = parseSourceManifest(
|
||||
JSON.parse(
|
||||
await fs.readFile(path.join(projectRoot, 'build/bun-source-manifest.json'), 'utf8'),
|
||||
await fs.readFile(path.join(projectRoot, 'packaging/bun/bun-source-manifest.json'), 'utf8'),
|
||||
),
|
||||
);
|
||||
const registrations = manifest.sources
|
||||
|
||||
@@ -6,7 +6,7 @@ cat <<'EOF'
|
||||
patch-yomitan.sh is retired.
|
||||
|
||||
SubMiner now uses the forked source submodule at vendor/subminer-yomitan and builds the
|
||||
Chromium extension artifact into build/yomitan.
|
||||
Chromium extension artifact into dist/yomitan.
|
||||
|
||||
Use:
|
||||
git submodule update --init --recursive
|
||||
|
||||
@@ -9,9 +9,9 @@ paths=(
|
||||
"tsconfig.json"
|
||||
"tsconfig.renderer.json"
|
||||
"tsconfig.typecheck.json"
|
||||
".prettierrc.json"
|
||||
".github"
|
||||
"build"
|
||||
"packaging/bun/bun-runtime-manifest.json"
|
||||
"packaging/bun/bun-source-manifest.json"
|
||||
"e2e"
|
||||
"launcher"
|
||||
"scripts"
|
||||
|
||||
@@ -14,9 +14,14 @@ const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = path.resolve(scriptDir, '..');
|
||||
|
||||
export const DEFAULT_PACKAGE_JSON_PATH = path.join(repoRoot, 'package.json');
|
||||
export const DEFAULT_MANIFEST_PATH = path.join(repoRoot, 'build', 'bun-runtime-manifest.json');
|
||||
export const DEFAULT_MANIFEST_PATH = path.join(
|
||||
repoRoot,
|
||||
'packaging',
|
||||
'bun',
|
||||
'bun-runtime-manifest.json',
|
||||
);
|
||||
export const DEFAULT_CACHE_DIR = path.join(repoRoot, '.tmp', 'bun-runtime');
|
||||
export const DEFAULT_LICENSES_SOURCE_DIR = path.join(repoRoot, 'resources', 'bun', 'licenses');
|
||||
export const DEFAULT_LICENSES_SOURCE_DIR = path.join(repoRoot, 'packaging', 'bun', 'licenses');
|
||||
export const STAGED_METADATA_FILE = 'metadata.json';
|
||||
export const REQUIRED_LICENSE_FILES = [
|
||||
'Bun-LICENSE.md',
|
||||
|
||||
@@ -35,7 +35,7 @@ function runtimeConfig() {
|
||||
'win32-x64': { file: 'bun-windows-x64-baseline.zip', sha256: '5'.repeat(64) },
|
||||
},
|
||||
licenseInventoryStatus: 'complete-for-bun-1.3.5-declared-linked-libraries',
|
||||
sourceManifest: 'build/bun-source-manifest.json',
|
||||
sourceManifest: 'packaging/bun/bun-source-manifest.json',
|
||||
correspondingSourceAsset: 'bun-v1.3.5-source.tar.gz',
|
||||
};
|
||||
}
|
||||
@@ -96,7 +96,7 @@ test('manifest version must match the exact packageManager Bun pin', () => {
|
||||
releaseTagCommit: 'fa5a5bbe556a4bda5bde77b4013aa6c3bb4ec9ab',
|
||||
artifacts: {},
|
||||
licenseInventoryStatus: 'partial',
|
||||
sourceManifest: 'build/bun-source-manifest.json',
|
||||
sourceManifest: 'packaging/bun/bun-source-manifest.json',
|
||||
correspondingSourceAsset: 'bun-v1.3.5-source.tar.gz',
|
||||
},
|
||||
'1.3.5',
|
||||
|
||||
@@ -637,7 +637,7 @@ test('AnkiIntegration queues YouTube media updates against recovered source URLs
|
||||
noteId: 404,
|
||||
noteInfo: {
|
||||
noteId: 404,
|
||||
fields: { ExpressionAudio: { value: '' }, Picture: { value: '' } },
|
||||
fields: { SentenceAudio: { value: '' }, Picture: { value: '' } },
|
||||
},
|
||||
label: 'resolved source',
|
||||
});
|
||||
@@ -648,8 +648,8 @@ test('AnkiIntegration queues YouTube media updates against recovered source URLs
|
||||
assert.equal(queued, true);
|
||||
assert.equal(updatedNotes.length, 1);
|
||||
assert.equal(updatedNotes[0]?.noteId, 404);
|
||||
assert.match(updatedNotes[0]?.fields.ExpressionAudio ?? '', /^\[sound:audio_/);
|
||||
assert.equal(updatedNotes[0]?.fields.SentenceAudio, undefined);
|
||||
assert.match(updatedNotes[0]?.fields.SentenceAudio ?? '', /^\[sound:audio_/);
|
||||
assert.equal(updatedNotes[0]?.fields.ExpressionAudio, undefined);
|
||||
assert.match(updatedNotes[0]?.fields.Picture ?? '', /^<img src="image_/);
|
||||
assert.equal(storedMedia.length, 2);
|
||||
assert.deepEqual(audioVolumeScales, [0.3 ** 3]);
|
||||
|
||||
@@ -45,6 +45,7 @@ import {
|
||||
} from './anki-field-config';
|
||||
import { createLogger } from './logger';
|
||||
import { captureLiveSubtitleMiningContext } from './core/services/mining';
|
||||
import { shiftSubtitleRangeToVideoClock } from './core/services/subtitle-clock';
|
||||
import {
|
||||
createUiFeedbackState,
|
||||
beginUpdateProgress,
|
||||
@@ -1029,10 +1030,10 @@ export class AnkiIntegration {
|
||||
Number.isFinite(this.mpvClient.currentSubEnd) &&
|
||||
this.mpvClient.currentSubEnd > this.mpvClient.currentSubStart
|
||||
) {
|
||||
return {
|
||||
startTime: this.mpvClient.currentSubStart,
|
||||
endTime: this.mpvClient.currentSubEnd,
|
||||
};
|
||||
return shiftSubtitleRangeToVideoClock(
|
||||
{ startTime: this.mpvClient.currentSubStart, endTime: this.mpvClient.currentSubEnd },
|
||||
this.mpvClient.currentSubDelay,
|
||||
);
|
||||
}
|
||||
|
||||
const currentTime = this.mpvClient.currentTimePos || 0;
|
||||
@@ -1672,7 +1673,7 @@ export class AnkiIntegration {
|
||||
if (this.config.fields?.miscInfo) {
|
||||
result.miscInfoValue = this.formatMiscInfoPattern(
|
||||
audioFilename,
|
||||
this.mpvClient.currentSubStart,
|
||||
this.mpvClient.currentSubStart + this.mpvClient.currentSubDelay,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1695,7 +1696,7 @@ export class AnkiIntegration {
|
||||
if (this.config.fields?.miscInfo && !result.miscInfoValue) {
|
||||
result.miscInfoValue = this.formatMiscInfoPattern(
|
||||
imageFilename,
|
||||
this.mpvClient.currentSubStart,
|
||||
this.mpvClient.currentSubStart + this.mpvClient.currentSubDelay,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
type MediaTimingReviewRequest,
|
||||
type WordCardKind,
|
||||
} from '../types/anki';
|
||||
import { shiftSubtitleRangeToVideoClock } from '../core/services/subtitle-clock';
|
||||
import { createLogger } from '../logger';
|
||||
import type { MediaInput } from '../media-input';
|
||||
import { SubtitleTimingTracker } from '../subtitle-timing-tracker';
|
||||
@@ -428,10 +429,12 @@ export class CardCreationService {
|
||||
return;
|
||||
}
|
||||
|
||||
let startTime = mpvClient.currentSubStart;
|
||||
let endTime = mpvClient.currentSubEnd;
|
||||
let { startTime, endTime } = shiftSubtitleRangeToVideoClock(
|
||||
{ startTime: mpvClient.currentSubStart, endTime: mpvClient.currentSubEnd },
|
||||
mpvClient.currentSubDelay,
|
||||
);
|
||||
|
||||
if (startTime === undefined || endTime === undefined) {
|
||||
if (mpvClient.currentSubStart === undefined || mpvClient.currentSubEnd === undefined) {
|
||||
const currentTime = mpvClient.currentTimePos || 0;
|
||||
const fallback = this.deps.getFallbackDurationSeconds() / 2;
|
||||
startTime = currentTime - fallback;
|
||||
|
||||
@@ -28,7 +28,7 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
|
||||
deck: '',
|
||||
fields: {
|
||||
word: 'Expression',
|
||||
audio: 'ExpressionAudio',
|
||||
audio: 'SentenceAudio',
|
||||
wordAudio: 'ExpressionAudio',
|
||||
image: 'Picture',
|
||||
sentence: 'Sentence',
|
||||
|
||||
@@ -401,7 +401,83 @@ test('updateAnilistPostWatchProgress skips when progress already reached', async
|
||||
}
|
||||
});
|
||||
|
||||
test('updateAnilistPostWatchProgress returns non-retryable error when media is not planning or watching', async () => {
|
||||
test('updateAnilistPostWatchProgress adds an exactly matched show missing from the list', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
let call = 0;
|
||||
let saveVariables: Record<string, unknown> | undefined;
|
||||
globalThis.fetch = (async (_input, init) => {
|
||||
call += 1;
|
||||
if (call === 1) {
|
||||
return createJsonResponse({
|
||||
data: {
|
||||
Page: {
|
||||
media: [{ id: 33, episodes: 12, title: { english: 'New Show' } }],
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
if (call === 2) {
|
||||
return createJsonResponse({
|
||||
data: {
|
||||
Media: { id: 33, mediaListEntry: null },
|
||||
},
|
||||
});
|
||||
}
|
||||
saveVariables = (JSON.parse(String(init?.body)) as { variables?: Record<string, unknown> })
|
||||
.variables;
|
||||
return createJsonResponse({
|
||||
data: { SaveMediaListEntry: { progress: 1, status: 'CURRENT' } },
|
||||
});
|
||||
}) as typeof fetch;
|
||||
|
||||
try {
|
||||
const result = await updateAnilistPostWatchProgress('token', 'New Show', 1);
|
||||
assert.equal(result.status, 'updated');
|
||||
assert.match(result.message, /added "New Show" to Watching at episode 1/i);
|
||||
assert.deepEqual(saveVariables, { mediaId: 33, progress: 1, status: 'CURRENT' });
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
|
||||
test('updateAnilistPostWatchProgress adds a pinned media id missing from the list', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
let call = 0;
|
||||
let saveVariables: Record<string, unknown> | undefined;
|
||||
globalThis.fetch = (async (_input, init) => {
|
||||
call += 1;
|
||||
if (call === 1) {
|
||||
return createJsonResponse({
|
||||
data: {
|
||||
Media: {
|
||||
id: 108489,
|
||||
episodes: 12,
|
||||
title: { english: 'Pinned Show' },
|
||||
mediaListEntry: null,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
saveVariables = (JSON.parse(String(init?.body)) as { variables?: Record<string, unknown> })
|
||||
.variables;
|
||||
return createJsonResponse({
|
||||
data: { SaveMediaListEntry: { progress: 12, status: 'COMPLETED' } },
|
||||
});
|
||||
}) as typeof fetch;
|
||||
|
||||
try {
|
||||
const result = await updateAnilistPostWatchProgress('token', 'Wrong Guess', 12, {
|
||||
mediaId: 108489,
|
||||
});
|
||||
assert.equal(result.status, 'updated');
|
||||
assert.match(result.message, /added "Pinned Show" at episode 12 and marked it completed/i);
|
||||
assert.deepEqual(saveVariables, { mediaId: 108489, progress: 12, status: 'COMPLETED' });
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
|
||||
test('updateAnilistPostWatchProgress does not add a loosely matched show missing from the list', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
let call = 0;
|
||||
globalThis.fetch = (async () => {
|
||||
@@ -410,7 +486,7 @@ test('updateAnilistPostWatchProgress returns non-retryable error when media is n
|
||||
return createJsonResponse({
|
||||
data: {
|
||||
Page: {
|
||||
media: [{ id: 33, episodes: 12, title: { english: 'Missing Show' } }],
|
||||
media: [{ id: 33, episodes: 12, title: { english: 'Missing Show Abridged Edition' } }],
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -427,6 +503,39 @@ test('updateAnilistPostWatchProgress returns non-retryable error when media is n
|
||||
assert.equal(result.status, 'error');
|
||||
assert.equal(result.retryable, false);
|
||||
assert.match(result.message, /not in your AniList Planning or Watching list/i);
|
||||
assert.equal(call, 2);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
|
||||
test('updateAnilistPostWatchProgress does not add the season 1 entry when the title carries an unparsed season marker', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
let call = 0;
|
||||
globalThis.fetch = (async () => {
|
||||
call += 1;
|
||||
if (call === 1) {
|
||||
return createJsonResponse({
|
||||
data: {
|
||||
Page: {
|
||||
media: [{ id: 33, episodes: 12, format: 'TV', title: { english: 'Demo Show' } }],
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
return createJsonResponse({
|
||||
data: {
|
||||
Media: { id: 33, mediaListEntry: null },
|
||||
},
|
||||
});
|
||||
}) as typeof fetch;
|
||||
|
||||
try {
|
||||
const result = await updateAnilistPostWatchProgress('token', 'Demo Show S2', 3);
|
||||
assert.equal(result.status, 'error');
|
||||
assert.equal(result.retryable, false);
|
||||
assert.match(result.message, /not in your AniList Planning or Watching list/i);
|
||||
assert.equal(call, 2);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as path from 'path';
|
||||
import { parseMediaInfo } from '../../../jimaku/utils';
|
||||
import { resolveMediaLookupTarget, sanitizeMediaTitle } from '../../../shared/media-identity';
|
||||
import type { AnilistRateLimiter } from './rate-limiter';
|
||||
import { resolveAnilistSeasonMedia } from './season-resolver';
|
||||
import { resolveAnilistSeasonMedia, stripSeasonSuffix } from './season-resolver';
|
||||
|
||||
const ANILIST_GRAPHQL_URL = 'https://graphql.anilist.co';
|
||||
|
||||
@@ -273,6 +273,9 @@ export async function updateAnilistPostWatchProgress(
|
||||
let mediaId = pinnedMediaId;
|
||||
let resolvedTitle: string | null = null;
|
||||
let resolvedEpisodes: number | null = null;
|
||||
// A missing list entry is only created when we trust the match; otherwise a fuzzy
|
||||
// search hit would add an unrelated show to the user's list.
|
||||
let confidentMatch = pinnedMediaId !== null;
|
||||
|
||||
if (mediaId === null) {
|
||||
let resolution: Awaited<ReturnType<typeof resolveAnilistSeasonMedia>>;
|
||||
@@ -312,6 +315,11 @@ export async function updateAnilistPostWatchProgress(
|
||||
mediaId = resolution.id;
|
||||
resolvedTitle = resolution.title;
|
||||
resolvedEpisodes = resolution.episodes;
|
||||
// With no parsed season, an exact match on a season-stripped title ("Show S2" ->
|
||||
// "Show") only certifies the season 1 anchor, not the entry being watched.
|
||||
const seasonMarkerStripped = stripSeasonSuffix(title).trim() !== title.trim();
|
||||
confidentMatch =
|
||||
resolution.exactTitleMatch && (resolution.requestedSeason !== null || !seasonMarkerStripped);
|
||||
}
|
||||
|
||||
const entryResponse = await anilistGraphQl<AnilistMediaEntryData>(
|
||||
@@ -358,7 +366,8 @@ export async function updateAnilistPostWatchProgress(
|
||||
: null);
|
||||
|
||||
const entry = entryMedia?.mediaListEntry ?? null;
|
||||
if (!entry || !isUpdateableListStatus(entry.status)) {
|
||||
const createEntry = !entry && confidentMatch;
|
||||
if (!createEntry && (!entry || !isUpdateableListStatus(entry.status))) {
|
||||
return {
|
||||
status: 'error',
|
||||
retryable: false,
|
||||
@@ -366,7 +375,7 @@ export async function updateAnilistPostWatchProgress(
|
||||
};
|
||||
}
|
||||
|
||||
const currentProgress = entry.progress ?? 0;
|
||||
const currentProgress = entry?.progress ?? 0;
|
||||
const shouldMarkCompleted = isKnownFinalEpisode(pickedEpisodes, episode);
|
||||
if (typeof currentProgress === 'number' && currentProgress >= episode && !shouldMarkCompleted) {
|
||||
return {
|
||||
@@ -397,6 +406,15 @@ export async function updateAnilistPostWatchProgress(
|
||||
return { status: 'error', message: `AniList update failed: ${saveError}` };
|
||||
}
|
||||
|
||||
if (createEntry) {
|
||||
return {
|
||||
status: 'updated',
|
||||
message: shouldMarkCompleted
|
||||
? `AniList added "${pickedTitle}" at episode ${episode} and marked it completed.`
|
||||
: `AniList added "${pickedTitle}" to Watching at episode ${episode}.`,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
status: 'updated',
|
||||
message: shouldMarkCompleted
|
||||
|
||||
@@ -11,9 +11,9 @@ test('Hachidori resolves development and packaged artifacts without falling back
|
||||
assert.equal(
|
||||
resolveHachidoriExtensionPath({
|
||||
...options,
|
||||
exists: (p) => p === '/app/build/hachidori/manifest.json',
|
||||
exists: (p) => p === '/app/dist/hachidori/manifest.json',
|
||||
}),
|
||||
'/app/build/hachidori',
|
||||
'/app/dist/hachidori',
|
||||
);
|
||||
assert.equal(
|
||||
resolveHachidoriExtensionPath({
|
||||
|
||||
@@ -15,7 +15,7 @@ export function resolveHachidoriExtensionPath(options: {
|
||||
exists?: (candidate: string) => boolean;
|
||||
}): string {
|
||||
const candidates = [
|
||||
path.resolve(options.moduleDir, '../../../build/hachidori'),
|
||||
path.resolve(options.moduleDir, '../../../dist/hachidori'),
|
||||
path.join(options.resourcesPath, 'hachidori'),
|
||||
];
|
||||
const found = candidates.find((candidate) =>
|
||||
|
||||
@@ -55,6 +55,7 @@ export {
|
||||
subtitleCueListSeekTime,
|
||||
subtitleCueSeekTime,
|
||||
} from './subtitle-cue-navigation';
|
||||
export { shiftSubtitleRangeToVideoClock, toSubtitleClock, toVideoClock } from './subtitle-clock';
|
||||
export { createFrequencyDictionaryLookup } from './frequency-dictionary';
|
||||
export { createJlptVocabularyLookup } from './jlpt-vocab';
|
||||
export {
|
||||
|
||||
@@ -89,6 +89,7 @@ function createSubtitleSidebarSnapshotFixture(): SubtitleSidebarSnapshot {
|
||||
cuesRevision: 1,
|
||||
cues: [],
|
||||
currentTimeSec: null,
|
||||
subDelay: 0,
|
||||
currentSubtitle: { text: '', startTime: null, endTime: null },
|
||||
config: {
|
||||
enabled: false,
|
||||
|
||||
@@ -77,6 +77,7 @@ test('mineSentenceCard handles missing integration and disconnected mpv', async
|
||||
currentSubText: 'line',
|
||||
currentSubStart: 1,
|
||||
currentSubEnd: 2,
|
||||
currentSubDelay: 0,
|
||||
},
|
||||
showMpvOsd: (text) => osd.push(text),
|
||||
}),
|
||||
@@ -109,6 +110,7 @@ test('mineSentenceCard creates sentence card from mpv subtitle state', async ()
|
||||
currentSubText: 'subtitle line',
|
||||
currentSubStart: 10,
|
||||
currentSubEnd: 12,
|
||||
currentSubDelay: 0,
|
||||
currentSecondarySubText: 'secondary line',
|
||||
},
|
||||
showMpvOsd: () => {},
|
||||
@@ -148,6 +150,7 @@ test('mineSentenceCard prefers a canonical primary subtitle snapshot', async ()
|
||||
currentSubText: '今今今手手手',
|
||||
currentSubStart: 11.4,
|
||||
currentSubEnd: 11.8,
|
||||
currentSubDelay: 0,
|
||||
currentSecondarySubText: 'English subtitle',
|
||||
},
|
||||
primarySubtitle: {
|
||||
@@ -187,6 +190,7 @@ test('mineSentenceCard uses normalized secondary subtitle state instead of raw m
|
||||
currentSubText: '日本語字幕',
|
||||
currentSubStart: 10,
|
||||
currentSubEnd: 12,
|
||||
currentSubDelay: 0,
|
||||
currentSecondarySubText: 'Your\nmosaic',
|
||||
requestProperty: async () => {
|
||||
requestedRawSecondaryText = true;
|
||||
@@ -218,6 +222,7 @@ test('mineSentenceCard omits normalized secondary text that matches the primary
|
||||
currentSubText: '日本語字幕',
|
||||
currentSubStart: 10,
|
||||
currentSubEnd: 12,
|
||||
currentSubDelay: 0,
|
||||
currentSecondarySubText: '日本語字幕',
|
||||
},
|
||||
showMpvOsd: () => {},
|
||||
@@ -396,7 +401,7 @@ test('handleMineSentenceDigit joins per-entry secondary subtitles when available
|
||||
|
||||
test('captureLiveSubtitleMiningContext snapshots the current line and timings', () => {
|
||||
const context = captureLiveSubtitleMiningContext(
|
||||
{ currentSubText: ' 食べる ', currentSubStart: 12.5, currentSubEnd: 15.25 },
|
||||
{ currentSubText: ' 食べる ', currentSubStart: 12.5, currentSubEnd: 15.25, currentSubDelay: 0 },
|
||||
() => 1234,
|
||||
);
|
||||
|
||||
@@ -409,6 +414,16 @@ test('captureLiveSubtitleMiningContext snapshots the current line and timings',
|
||||
});
|
||||
});
|
||||
|
||||
test('captureLiveSubtitleMiningContext moves sub-delay retimed lines onto the video clock', () => {
|
||||
const context = captureLiveSubtitleMiningContext(
|
||||
{ currentSubText: '食べる', currentSubStart: 5, currentSubEnd: 8, currentSubDelay: -1.5 },
|
||||
() => 1234,
|
||||
);
|
||||
|
||||
assert.equal(context?.startTime, 3.5);
|
||||
assert.equal(context?.endTime, 6.5);
|
||||
});
|
||||
|
||||
test('captureLiveSubtitleMiningContext rejects missing client, empty text and bad timings', () => {
|
||||
assert.equal(captureLiveSubtitleMiningContext(null), null);
|
||||
assert.equal(
|
||||
@@ -416,6 +431,7 @@ test('captureLiveSubtitleMiningContext rejects missing client, empty text and ba
|
||||
currentSubText: ' ',
|
||||
currentSubStart: 1,
|
||||
currentSubEnd: 2,
|
||||
currentSubDelay: 0,
|
||||
}),
|
||||
null,
|
||||
);
|
||||
@@ -424,6 +440,7 @@ test('captureLiveSubtitleMiningContext rejects missing client, empty text and ba
|
||||
currentSubText: 'line',
|
||||
currentSubStart: 5,
|
||||
currentSubEnd: 5,
|
||||
currentSubDelay: 0,
|
||||
}),
|
||||
null,
|
||||
);
|
||||
@@ -432,6 +449,7 @@ test('captureLiveSubtitleMiningContext rejects missing client, empty text and ba
|
||||
currentSubText: 'line',
|
||||
currentSubStart: NaN,
|
||||
currentSubEnd: 2,
|
||||
currentSubDelay: 0,
|
||||
}),
|
||||
null,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { SubtitleTimingBlock } from '../../subtitle-timing-tracker';
|
||||
import type { SubtitleMiningContext } from '../../types/subtitle';
|
||||
import { shiftSubtitleRangeToVideoClock } from './subtitle-clock';
|
||||
|
||||
interface SubtitleTimingTrackerLike {
|
||||
getRecentBlocks: (count: number) => string[];
|
||||
@@ -25,6 +26,7 @@ interface MpvClientLike {
|
||||
currentSubText: string;
|
||||
currentSubStart: number;
|
||||
currentSubEnd: number;
|
||||
currentSubDelay: number;
|
||||
currentSecondarySubText?: string;
|
||||
requestProperty?: (name: string) => Promise<unknown>;
|
||||
}
|
||||
@@ -62,7 +64,10 @@ export function handleMultiCopyDigit(
|
||||
* line is on screen by then; callers capture here at mining time instead.
|
||||
*/
|
||||
export function captureLiveSubtitleMiningContext(
|
||||
client: Pick<MpvClientLike, 'currentSubText' | 'currentSubStart' | 'currentSubEnd'> | null,
|
||||
client: Pick<
|
||||
MpvClientLike,
|
||||
'currentSubText' | 'currentSubStart' | 'currentSubEnd' | 'currentSubDelay'
|
||||
> | null,
|
||||
now: () => number = Date.now,
|
||||
): SubtitleMiningContext | null {
|
||||
if (!client) {
|
||||
@@ -73,7 +78,10 @@ export function captureLiveSubtitleMiningContext(
|
||||
if (!text || !Number.isFinite(startTime) || !Number.isFinite(endTime) || endTime <= startTime) {
|
||||
return null;
|
||||
}
|
||||
return { source: 'overlay', text, startTime, endTime, capturedAtMs: now() };
|
||||
return shiftSubtitleRangeToVideoClock<SubtitleMiningContext>(
|
||||
{ source: 'overlay', text, startTime, endTime, capturedAtMs: now() },
|
||||
client.currentSubDelay,
|
||||
);
|
||||
}
|
||||
|
||||
export function copyCurrentSubtitle(deps: {
|
||||
@@ -167,6 +175,7 @@ export async function markLastCardAsAudioCard(deps: {
|
||||
export async function mineSentenceCard(deps: {
|
||||
ankiIntegration: AnkiIntegrationLike | null;
|
||||
mpvClient: MpvClientLike | null;
|
||||
/** Already on the video clock, like every `SubtitleMiningContext`. */
|
||||
primarySubtitle?: Pick<SubtitleMiningContext, 'text' | 'startTime' | 'endTime'>;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}): Promise<boolean> {
|
||||
@@ -185,10 +194,16 @@ export async function mineSentenceCard(deps: {
|
||||
}
|
||||
|
||||
const secondarySubText = getCurrentSecondarySubTextForSentenceCard(mpvClient, primaryText);
|
||||
const range =
|
||||
deps.primarySubtitle ??
|
||||
shiftSubtitleRangeToVideoClock(
|
||||
{ startTime: mpvClient.currentSubStart, endTime: mpvClient.currentSubEnd },
|
||||
mpvClient.currentSubDelay,
|
||||
);
|
||||
return await anki.createSentenceCard(
|
||||
primaryText,
|
||||
deps.primarySubtitle?.startTime ?? mpvClient.currentSubStart,
|
||||
deps.primarySubtitle?.endTime ?? mpvClient.currentSubEnd,
|
||||
range.startTime,
|
||||
range.endTime,
|
||||
secondarySubText,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ const MPV_SUBTITLE_PROPERTY_OBSERVATIONS: string[] = [
|
||||
'path',
|
||||
'sub-start',
|
||||
'sub-end',
|
||||
'sub-delay',
|
||||
'time-pos',
|
||||
'secondary-sub-text',
|
||||
'aid',
|
||||
|
||||
@@ -73,6 +73,8 @@ function createDeps(overrides: Partial<MpvProtocolHandleMessageDeps> = {}): {
|
||||
getCurrentSubStart: () => 0,
|
||||
setCurrentSubEnd: () => {},
|
||||
getCurrentSubEnd: () => 0,
|
||||
setCurrentSubDelay: () => {},
|
||||
getCurrentSubDelay: () => 0,
|
||||
emitMediaPathChange: (payload) => {
|
||||
state.mediaPath = payload.path;
|
||||
},
|
||||
@@ -131,6 +133,22 @@ test('dispatchMpvProtocolMessage emits subtitle text on property change', async
|
||||
assert.deepEqual(state.events, [{ text: '字幕', isOverlayVisible: false }]);
|
||||
});
|
||||
|
||||
test('dispatchMpvProtocolMessage tracks sub-delay retiming', async () => {
|
||||
const delays: number[] = [];
|
||||
const { deps } = createDeps({ setCurrentSubDelay: (value) => delays.push(value) });
|
||||
|
||||
await dispatchMpvProtocolMessage(
|
||||
{ event: 'property-change', name: 'sub-delay', data: 1.5 },
|
||||
deps,
|
||||
);
|
||||
await dispatchMpvProtocolMessage(
|
||||
{ event: 'property-change', name: 'sub-delay', data: null },
|
||||
deps,
|
||||
);
|
||||
|
||||
assert.deepEqual(delays, [1.5, 0]);
|
||||
});
|
||||
|
||||
test('dispatchMpvProtocolMessage widens halfwidth katakana in subtitle text', async () => {
|
||||
const { deps, state } = createDeps();
|
||||
|
||||
@@ -379,6 +397,29 @@ test('dispatchMpvProtocolMessage pauses on sub-end when pendingPauseAtSubEnd is
|
||||
});
|
||||
});
|
||||
|
||||
test('dispatchMpvProtocolMessage pauses at the sub-delay retimed sub-end', async () => {
|
||||
let pauseAtTime: number | null = null;
|
||||
let subDelay = 1.5;
|
||||
const { deps } = createDeps({
|
||||
getPendingPauseAtSubEnd: () => true,
|
||||
getCurrentSubDelay: () => subDelay,
|
||||
setCurrentSubDelay: (next) => {
|
||||
subDelay = next;
|
||||
},
|
||||
getPauseAtTime: () => pauseAtTime,
|
||||
setPauseAtTime: (next) => {
|
||||
pauseAtTime = next;
|
||||
},
|
||||
});
|
||||
|
||||
await dispatchMpvProtocolMessage({ event: 'property-change', name: 'sub-end', data: 42 }, deps);
|
||||
assert.equal(pauseAtTime, 43.5);
|
||||
|
||||
// Retiming before the replay reaches its end moves the pause with the line.
|
||||
await dispatchMpvProtocolMessage({ event: 'property-change', name: 'sub-delay', data: 2 }, deps);
|
||||
assert.equal(pauseAtTime, 44);
|
||||
});
|
||||
|
||||
test('dispatchMpvProtocolMessage updates current time before emitting time-pos change', async () => {
|
||||
const calls: string[] = [];
|
||||
let currentTimePos = 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { MpvSubtitleRenderMetrics } from '../../types';
|
||||
import { sanitizeMediaTitle } from '../../shared/media-identity';
|
||||
import { widenHalfwidthKana } from '../utils/halfwidth-kana';
|
||||
import { toVideoClock } from './subtitle-clock';
|
||||
|
||||
export type MpvMessage = {
|
||||
event?: string;
|
||||
@@ -64,6 +65,8 @@ export interface MpvProtocolHandleMessageDeps {
|
||||
getCurrentSubStart: () => number;
|
||||
setCurrentSubEnd: (value: number) => void;
|
||||
getCurrentSubEnd: () => number;
|
||||
setCurrentSubDelay: (value: number) => void;
|
||||
getCurrentSubDelay: () => number;
|
||||
emitMediaPathChange: (payload: { path: string }) => void;
|
||||
emitMediaTitleChange: (payload: { title: string | null }) => void;
|
||||
emitTimePosChange: (payload: { time: number }) => void;
|
||||
@@ -263,7 +266,8 @@ export async function dispatchMpvProtocolMessage(
|
||||
const subEnd = (msg.data as number) || 0;
|
||||
deps.setCurrentSubEnd(subEnd);
|
||||
if (deps.getPendingPauseAtSubEnd() && subEnd > 0) {
|
||||
deps.setPauseAtTime(subEnd);
|
||||
// `sub-end` is on the subtitle clock; the pause check compares it with `time-pos`.
|
||||
deps.setPauseAtTime(toVideoClock(subEnd, deps.getCurrentSubDelay()));
|
||||
deps.setPendingPauseAtSubEnd(false);
|
||||
deps.sendCommand({ command: ['set_property', 'pause', false] });
|
||||
}
|
||||
@@ -272,6 +276,16 @@ export async function dispatchMpvProtocolMessage(
|
||||
start: deps.getCurrentSubStart(),
|
||||
end: deps.getCurrentSubEnd(),
|
||||
});
|
||||
} else if (msg.name === 'sub-delay') {
|
||||
const parsed = typeof msg.data === 'number' ? msg.data : Number(msg.data);
|
||||
const delay = Number.isFinite(parsed) ? parsed : 0;
|
||||
// A scheduled replay pause sits at the line's end on the video clock; retiming
|
||||
// mid-replay moves that end, so the pause moves with it.
|
||||
const pauseAtTime = deps.getPauseAtTime();
|
||||
if (pauseAtTime !== null) {
|
||||
deps.setPauseAtTime(pauseAtTime + delay - deps.getCurrentSubDelay());
|
||||
}
|
||||
deps.setCurrentSubDelay(delay);
|
||||
} else if (msg.name === 'secondary-sub-text') {
|
||||
const nextSubText = (msg.data as string) || '';
|
||||
deps.setCurrentSecondarySubText(nextSubText);
|
||||
|
||||
@@ -160,6 +160,8 @@ export class MpvIpcClient implements MpvClient {
|
||||
public currentTimePos = 0;
|
||||
public currentSubStart = 0;
|
||||
public currentSubEnd = 0;
|
||||
/** mpv `sub-delay`: seconds each primary line plays after its `sub-start`/`sub-end`. */
|
||||
public currentSubDelay = 0;
|
||||
public currentSubText = '';
|
||||
public currentSecondarySubText = '';
|
||||
public currentAudioStreamIndex: number | null = null;
|
||||
@@ -459,6 +461,10 @@ export class MpvIpcClient implements MpvClient {
|
||||
this.currentSubEnd = value;
|
||||
},
|
||||
getCurrentSubEnd: () => this.currentSubEnd,
|
||||
setCurrentSubDelay: (value: number) => {
|
||||
this.currentSubDelay = value;
|
||||
},
|
||||
getCurrentSubDelay: () => this.currentSubDelay,
|
||||
emitMediaPathChange: (payload) => {
|
||||
this.emit('media-path-change', payload);
|
||||
},
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* mpv's `sub-start`/`sub-end` and parsed cues carry the subtitle file's own timestamps
|
||||
* (the subtitle clock), but mpv plays each line `sub-delay` seconds later (z/x retiming,
|
||||
* `sub-step`). Playback position, seeks, and media cuts are on the video clock, so any
|
||||
* value crossing between the two converts here.
|
||||
*/
|
||||
|
||||
function finiteDelay(subDelay: number): number {
|
||||
return Number.isFinite(subDelay) ? subDelay : 0;
|
||||
}
|
||||
|
||||
/** Playback position (`time-pos`) on the subtitle clock, comparable with cue times. */
|
||||
export function toSubtitleClock(videoTimeSec: number, subDelay: number): number {
|
||||
return videoTimeSec - finiteDelay(subDelay);
|
||||
}
|
||||
|
||||
/** Subtitle-clock seconds on the video clock, for seeks. */
|
||||
export function toVideoClock(subtitleTimeSec: number, subDelay: number): number {
|
||||
return subtitleTimeSec + finiteDelay(subDelay);
|
||||
}
|
||||
|
||||
/** A subtitle-clock range on the video clock, for mining and media generation. */
|
||||
export function shiftSubtitleRangeToVideoClock<T extends { startTime: number; endTime: number }>(
|
||||
range: T,
|
||||
subDelay: number,
|
||||
): T {
|
||||
const delay = finiteDelay(subDelay);
|
||||
if (delay === 0) {
|
||||
return range;
|
||||
}
|
||||
return { ...range, startTime: range.startTime + delay, endTime: range.endTime + delay };
|
||||
}
|
||||
@@ -26,7 +26,7 @@ test('next subtitle navigation skips generated ASS events and seeks to the next
|
||||
},
|
||||
];
|
||||
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 10.2), [
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 10.2, 0), [
|
||||
'seek',
|
||||
13.08,
|
||||
'absolute+exact',
|
||||
@@ -41,7 +41,7 @@ test('next subtitle navigation treats simultaneous sanitized cues as one line bo
|
||||
{ startTime: 13.02, endTime: 16, text: 'Next English' },
|
||||
];
|
||||
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 10.1), [
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 10.1, 0), [
|
||||
'seek',
|
||||
13.08,
|
||||
'absolute+exact',
|
||||
@@ -55,7 +55,7 @@ test('next subtitle navigation advances past the latest overlapping lyric', () =
|
||||
{ startTime: 16, endTime: 19, text: 'next lyric' },
|
||||
];
|
||||
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 13.2), [
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 13.2, 0), [
|
||||
'seek',
|
||||
16.08,
|
||||
'absolute+exact',
|
||||
@@ -68,7 +68,7 @@ test('previous subtitle navigation leaves the current cue and seeks to the prior
|
||||
{ startTime: 13, endTime: 16, text: 'current line' },
|
||||
];
|
||||
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', -1], cues, 14.5), [
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', -1], cues, 14.5, 0), [
|
||||
'seek',
|
||||
10.08,
|
||||
'absolute+exact',
|
||||
@@ -78,8 +78,22 @@ test('previous subtitle navigation leaves the current cue and seeks to the prior
|
||||
test('subtitle navigation falls back when no sanitized destination exists', () => {
|
||||
const cues = [{ startTime: 10, endTime: 13, text: 'only line' }];
|
||||
|
||||
assert.equal(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 10.2), null);
|
||||
assert.equal(resolveSanitizedSubtitleSeekCommand(['seek', 5], cues, 10.2), null);
|
||||
assert.equal(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 10.2, 0), null);
|
||||
assert.equal(resolveSanitizedSubtitleSeekCommand(['seek', 5], cues, 10.2, 0), null);
|
||||
});
|
||||
|
||||
test('subtitle cue navigation finds and seeks cues on the sub-delay retimed timeline', () => {
|
||||
const cues = [
|
||||
{ startTime: 10, endTime: 13, text: 'one' },
|
||||
{ startTime: 13, endTime: 16, text: 'two' },
|
||||
];
|
||||
|
||||
// At 14.5 with a 2s delay, mpv is showing "one" (12-15 on the video clock).
|
||||
assert.deepEqual(resolveSanitizedSubtitleSeekCommand(['sub-seek', 1], cues, 14.5, 2), [
|
||||
'seek',
|
||||
15.08,
|
||||
'absolute+exact',
|
||||
]);
|
||||
});
|
||||
|
||||
test('sidebar cue seeks share the boundary-safe sanitized cue timestamp', () => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { toSubtitleClock, toVideoClock } from './subtitle-clock';
|
||||
import type { SubtitleCue } from './subtitle-cue-parser';
|
||||
|
||||
const CUE_START_GROUP_TOLERANCE_SECONDS = 0.05;
|
||||
@@ -80,8 +81,10 @@ export function subtitleCueListSeekTime(
|
||||
export function resolveSanitizedSubtitleSeekCommand(
|
||||
command: readonly (string | number)[],
|
||||
cues: readonly SubtitleCue[],
|
||||
currentTimeSec: number,
|
||||
videoTimeSec: number,
|
||||
subDelay: number,
|
||||
): (string | number)[] | null {
|
||||
const currentTimeSec = toSubtitleClock(videoTimeSec, subDelay);
|
||||
if (
|
||||
command.length < 2 ||
|
||||
command[0] !== 'sub-seek' ||
|
||||
@@ -124,5 +127,5 @@ export function resolveSanitizedSubtitleSeekCommand(
|
||||
if (!destination) {
|
||||
return null;
|
||||
}
|
||||
return ['seek', subtitleCueSeekTime(destination.cue), 'absolute+exact'];
|
||||
return ['seek', toVideoClock(subtitleCueSeekTime(destination.cue), subDelay), 'absolute+exact'];
|
||||
}
|
||||
@@ -20,7 +20,7 @@ test('getYomitanExtensionSearchPaths prioritizes generated build output before p
|
||||
});
|
||||
|
||||
assert.deepEqual(searchPaths, [
|
||||
path.join(repoRoot, 'build', 'yomitan'),
|
||||
path.join(repoRoot, 'dist', 'yomitan'),
|
||||
path.join(resourcesPath, 'yomitan'),
|
||||
'/usr/share/SubMiner/yomitan',
|
||||
path.join(userDataPath, 'yomitan'),
|
||||
@@ -29,19 +29,19 @@ test('getYomitanExtensionSearchPaths prioritizes generated build output before p
|
||||
|
||||
test('resolveExistingYomitanExtensionPath returns first manifest-backed candidate', () => {
|
||||
const existing = new Set<string>([
|
||||
path.join('/repo', 'build', 'yomitan', 'manifest.json'),
|
||||
path.join('/repo', 'dist', 'yomitan', 'manifest.json'),
|
||||
path.join('/repo', 'vendor', 'subminer-yomitan', 'ext', 'manifest.json'),
|
||||
]);
|
||||
|
||||
const resolved = resolveExistingYomitanExtensionPath(
|
||||
[
|
||||
path.join('/repo', 'build', 'yomitan'),
|
||||
path.join('/repo', 'dist', 'yomitan'),
|
||||
path.join('/repo', 'vendor', 'subminer-yomitan', 'ext'),
|
||||
],
|
||||
(candidate) => existing.has(candidate),
|
||||
);
|
||||
|
||||
assert.equal(resolved, path.join('/repo', 'build', 'yomitan'));
|
||||
assert.equal(resolved, path.join('/repo', 'dist', 'yomitan'));
|
||||
});
|
||||
|
||||
test('resolveExistingYomitanExtensionPath ignores source tree without built manifest', () => {
|
||||
|
||||
@@ -22,12 +22,10 @@ export function getYomitanExtensionSearchPaths(
|
||||
const searchPaths: string[] = [];
|
||||
|
||||
pushUnique(searchPaths, options.explicitPath ? path.resolve(options.explicitPath) : null);
|
||||
pushUnique(searchPaths, options.cwd ? path.resolve(options.cwd, 'build', 'yomitan') : null);
|
||||
pushUnique(searchPaths, options.cwd ? path.resolve(options.cwd, 'dist', 'yomitan') : null);
|
||||
pushUnique(
|
||||
searchPaths,
|
||||
options.moduleDir
|
||||
? path.resolve(options.moduleDir, '..', '..', '..', 'build', 'yomitan')
|
||||
: null,
|
||||
options.moduleDir ? path.resolve(options.moduleDir, '..', '..', '..', 'dist', 'yomitan') : null,
|
||||
);
|
||||
pushUnique(
|
||||
searchPaths,
|
||||
|
||||
+269
-382
@@ -155,7 +155,6 @@ import {
|
||||
buildAnilistSetupUrl,
|
||||
consumeAnilistSetupCallbackUrl,
|
||||
createAnilistStateRuntime,
|
||||
createBuildOpenAnilistSetupWindowMainDepsHandler,
|
||||
createMaybeFocusExistingAnilistSetupWindowHandler,
|
||||
createOpenAnilistSetupWindowHandler,
|
||||
findAnilistSetupDeepLinkArgvUrl,
|
||||
@@ -168,8 +167,6 @@ import { DEFAULT_MIN_WATCH_RATIO } from './shared/watch-threshold';
|
||||
import { shouldShowTexthookerTrayEntry } from './main/runtime/tray-main-actions';
|
||||
import {
|
||||
createApplyJellyfinMpvDefaultsHandler,
|
||||
createBuildApplyJellyfinMpvDefaultsMainDepsHandler,
|
||||
createBuildGetDefaultSocketPathMainDepsHandler,
|
||||
createGetDefaultSocketPathHandler,
|
||||
buildJellyfinSetupFormHtml,
|
||||
parseJellyfinSetupSubmissionUrl,
|
||||
@@ -184,22 +181,7 @@ import {
|
||||
createBuildConfigHotReloadRuntimeMainDepsHandler,
|
||||
createBuildWatchConfigPathMainDepsHandler,
|
||||
createWatchConfigPathHandler,
|
||||
createBuildOverlayContentMeasurementStoreMainDepsHandler,
|
||||
createBuildOverlayModalRuntimeMainDepsHandler,
|
||||
createBuildAppendClipboardVideoToQueueMainDepsHandler,
|
||||
createBuildHandleOverlayModalClosedMainDepsHandler,
|
||||
createBuildLoadSubtitlePositionMainDepsHandler,
|
||||
createBuildSaveSubtitlePositionMainDepsHandler,
|
||||
createBuildFieldGroupingOverlayMainDepsHandler,
|
||||
createBuildGetFieldGroupingResolverMainDepsHandler,
|
||||
createBuildSetFieldGroupingResolverMainDepsHandler,
|
||||
createBuildOverlayVisibilityRuntimeMainDepsHandler,
|
||||
createBuildBroadcastRuntimeOptionsChangedMainDepsHandler,
|
||||
createBuildGetRuntimeOptionsStateMainDepsHandler,
|
||||
createBuildOpenRuntimeOptionsPaletteMainDepsHandler,
|
||||
createBuildRestorePreviousSecondarySubVisibilityMainDepsHandler,
|
||||
createBuildSendToActiveOverlayWindowMainDepsHandler,
|
||||
createBuildSetOverlayDebugVisualizationEnabledMainDepsHandler,
|
||||
createTrayRuntimeHandlers,
|
||||
createOverlayVisibilityRuntime,
|
||||
createGetRuntimeOptionsStateHandler,
|
||||
@@ -219,12 +201,6 @@ import {
|
||||
resolveSubtitleStyleForRenderer,
|
||||
} from './main/runtime/domains/overlay';
|
||||
import {
|
||||
createBuildAnilistStateRuntimeMainDepsHandler,
|
||||
createBuildConfigDerivedRuntimeMainDepsHandler,
|
||||
createBuildImmersionMediaRuntimeMainDepsHandler,
|
||||
createBuildMainSubsyncRuntimeMainDepsHandler,
|
||||
createBuildSubtitleProcessingControllerMainDepsHandler,
|
||||
createBuildMediaRuntimeMainDepsHandler,
|
||||
createBuildDictionaryRootsMainHandler,
|
||||
createBuildFrequencyDictionaryRootsMainHandler,
|
||||
createBuildFrequencyDictionaryRuntimeMainDepsHandler,
|
||||
@@ -244,14 +220,6 @@ import {
|
||||
resolvePrimarySubtitle,
|
||||
} from './main/runtime/primary-subtitle-text';
|
||||
import {
|
||||
createBuildCopyCurrentSubtitleMainDepsHandler,
|
||||
createBuildHandleMineSentenceDigitMainDepsHandler,
|
||||
createBuildHandleMultiCopyDigitMainDepsHandler,
|
||||
createBuildMarkLastCardAsAudioCardMainDepsHandler,
|
||||
createBuildMineSentenceCardMainDepsHandler,
|
||||
createBuildRefreshKnownWordCacheMainDepsHandler,
|
||||
createBuildTriggerFieldGroupingMainDepsHandler,
|
||||
createBuildUpdateLastCardFromClipboardMainDepsHandler,
|
||||
createMarkLastCardAsAudioCardHandler,
|
||||
createMineSentenceCardHandler,
|
||||
createRefreshKnownWordCacheHandler,
|
||||
@@ -291,7 +259,6 @@ import {
|
||||
createOverlayContentMeasurementStore,
|
||||
createOverlayManager,
|
||||
createOverlayWindow as createOverlayWindowCore,
|
||||
createSubtitleProcessingController,
|
||||
createTokenizerDepsRuntime,
|
||||
cycleSecondarySubMode as cycleSecondarySubModeCore,
|
||||
deleteYomitanDictionaryByTitle,
|
||||
@@ -328,9 +295,11 @@ import {
|
||||
setMpvSubVisibilityRuntime,
|
||||
setOverlayDebugVisualizationEnabledRuntime,
|
||||
setVisibleOverlayVisible as setVisibleOverlayVisibleCore,
|
||||
shiftSubtitleRangeToVideoClock,
|
||||
showMpvOsdRuntime,
|
||||
JellyfinPlaybackReporter,
|
||||
tokenizeSubtitle as tokenizeSubtitleCore,
|
||||
toSubtitleClock,
|
||||
triggerFieldGrouping as triggerFieldGroupingCore,
|
||||
upsertYomitanDictionarySettings,
|
||||
updateLastCardFromClipboard as updateLastCardFromClipboardCore,
|
||||
@@ -426,8 +395,10 @@ import {
|
||||
shouldQuitOnWindowAllClosedForTrayState,
|
||||
} from './main/runtime/startup-tray-policy';
|
||||
import { createLogExportTrayRuntime } from './main/runtime/log-export-tray';
|
||||
import { createImmersionTrackerStartupHandler } from './main/runtime/immersion-startup';
|
||||
import { createBuildImmersionTrackerStartupMainDepsHandler } from './main/runtime/immersion-startup-main-deps';
|
||||
import {
|
||||
createImmersionTrackerStartupHandler,
|
||||
type ImmersionTrackerStartupDeps,
|
||||
} from './main/runtime/immersion-startup';
|
||||
import {
|
||||
createRunStatsCliCommandHandler,
|
||||
writeStatsCliCommandResponse,
|
||||
@@ -527,6 +498,7 @@ import {
|
||||
getJlptDictionarySearchPaths,
|
||||
} from './main/jlpt-runtime';
|
||||
import { createMediaRuntimeService } from './main/media-runtime';
|
||||
import { createPrefetchAwareSubtitleProcessingController } from './main/runtime/subtitle-processing-runtime';
|
||||
import { createOverlayVisibilityRuntimeService } from './main/overlay-visibility-runtime';
|
||||
import { createDiscordPresenceRuntime } from './main/runtime/discord-presence-runtime';
|
||||
import { createCharacterDictionaryRuntimeService } from './main/character-dictionary-runtime';
|
||||
@@ -705,15 +677,10 @@ let backgroundWarmupsStarted = false;
|
||||
let yomitanLoadInFlight: Promise<Extension | null> | null = null;
|
||||
let notifyAnilistTokenStoreWarning: (message: string) => void = () => {};
|
||||
|
||||
const buildApplyJellyfinMpvDefaultsMainDepsHandler =
|
||||
createBuildApplyJellyfinMpvDefaultsMainDepsHandler({
|
||||
sendMpvCommandRuntime: (client, command) => sendMpvCommandRuntime(client, command),
|
||||
jellyfinLangPref: JELLYFIN_LANG_PREF,
|
||||
});
|
||||
const applyJellyfinMpvDefaultsMainDeps = buildApplyJellyfinMpvDefaultsMainDepsHandler();
|
||||
const applyJellyfinMpvDefaultsHandler = createApplyJellyfinMpvDefaultsHandler(
|
||||
applyJellyfinMpvDefaultsMainDeps,
|
||||
);
|
||||
const applyJellyfinMpvDefaultsHandler = createApplyJellyfinMpvDefaultsHandler({
|
||||
sendMpvCommandRuntime: (client, command) => sendMpvCommandRuntime(client, command),
|
||||
jellyfinLangPref: JELLYFIN_LANG_PREF,
|
||||
});
|
||||
|
||||
const isDev = process.argv.includes('--dev') || process.argv.includes('--debug');
|
||||
const texthookerService = new Texthooker(() => {
|
||||
@@ -756,11 +723,9 @@ const texthookerService = new Texthooker(() => {
|
||||
});
|
||||
let syncOverlayShortcutsForModal: (isActive: boolean) => void = () => {};
|
||||
let syncOverlayVisibilityForModal: () => void = () => {};
|
||||
const buildGetDefaultSocketPathMainDepsHandler = createBuildGetDefaultSocketPathMainDepsHandler({
|
||||
const getDefaultSocketPathHandler = createGetDefaultSocketPathHandler({
|
||||
platform: process.platform,
|
||||
});
|
||||
const getDefaultSocketPathMainDeps = buildGetDefaultSocketPathMainDepsHandler();
|
||||
const getDefaultSocketPathHandler = createGetDefaultSocketPathHandler(getDefaultSocketPathMainDeps);
|
||||
|
||||
type BootServices = MainBootServicesResult<
|
||||
ConfigService,
|
||||
@@ -850,45 +815,46 @@ const bootServices = createMainBootServices({
|
||||
}),
|
||||
createOverlayModalInputState,
|
||||
createOverlayContentMeasurementStore: ({ logger }) => {
|
||||
const buildHandler = createBuildOverlayContentMeasurementStoreMainDepsHandler({
|
||||
return createOverlayContentMeasurementStore({
|
||||
now: () => Date.now(),
|
||||
warn: (message: string) => logger.warn(message),
|
||||
});
|
||||
return createOverlayContentMeasurementStore(buildHandler());
|
||||
},
|
||||
getSyncOverlayShortcutsForModal: () => syncOverlayShortcutsForModal,
|
||||
getSyncOverlayVisibilityForModal: () => syncOverlayVisibilityForModal,
|
||||
createOverlayModalRuntime: ({ overlayManager, overlayModalInputState }) => {
|
||||
const buildHandler = createBuildOverlayModalRuntimeMainDepsHandler({
|
||||
getMainWindow: () => overlayManager.getMainWindow(),
|
||||
getModalWindow: () => overlayManager.getModalWindow(),
|
||||
createModalWindow: () => createModalWindow(),
|
||||
getModalGeometry: () => overlayGeometryRuntime.getCurrentOverlayGeometry(),
|
||||
setModalWindowBounds: (geometry) => overlayManager.setModalWindowBounds(geometry),
|
||||
});
|
||||
return createOverlayModalRuntimeService(buildHandler(), {
|
||||
onModalStateChange: (isActive: boolean) =>
|
||||
overlayModalInputState.handleModalInputStateChange(isActive),
|
||||
// On macOS, after the last modal closes the post-close visibility sync hides the overlay
|
||||
// when neither it nor mpv is focused, and keyboard focus is left in limbo (mpv keys like
|
||||
// shift-to-unpause stop working). Programmatically focusing mpv from our background helper
|
||||
// is refused by macOS (most visibly in native fullscreen), so instead resign SubMiner's
|
||||
// active status — exactly what a manual click does — handing focus back to the previously
|
||||
// active app (mpv). The overlay is already hidden at this point, so app.hide() hides nothing
|
||||
// visible; once mpv is focused the tracker re-shows the overlay above it.
|
||||
onFinalModalClosed: () => {
|
||||
void restoreMacOSMpvFocusAfterModalClose({
|
||||
platform: process.platform,
|
||||
focusMpv: async () => {
|
||||
app.hide();
|
||||
},
|
||||
getWindowTracker: () => appState.windowTracker,
|
||||
updateVisibleOverlayVisibility: () =>
|
||||
overlayVisibilityRuntime.updateVisibleOverlayVisibility(),
|
||||
warn: (message, details) => logger.warn(message, details),
|
||||
});
|
||||
return createOverlayModalRuntimeService(
|
||||
{
|
||||
getMainWindow: () => overlayManager.getMainWindow(),
|
||||
getModalWindow: () => overlayManager.getModalWindow(),
|
||||
createModalWindow: () => createModalWindow(),
|
||||
getModalGeometry: () => overlayGeometryRuntime.getCurrentOverlayGeometry(),
|
||||
setModalWindowBounds: (geometry) => overlayManager.setModalWindowBounds(geometry),
|
||||
},
|
||||
});
|
||||
{
|
||||
onModalStateChange: (isActive: boolean) =>
|
||||
overlayModalInputState.handleModalInputStateChange(isActive),
|
||||
// On macOS, after the last modal closes the post-close visibility sync hides the overlay
|
||||
// when neither it nor mpv is focused, and keyboard focus is left in limbo (mpv keys like
|
||||
// shift-to-unpause stop working). Programmatically focusing mpv from our background helper
|
||||
// is refused by macOS (most visibly in native fullscreen), so instead resign SubMiner's
|
||||
// active status — exactly what a manual click does — handing focus back to the previously
|
||||
// active app (mpv). The overlay is already hidden at this point, so app.hide() hides nothing
|
||||
// visible; once mpv is focused the tracker re-shows the overlay above it.
|
||||
onFinalModalClosed: () => {
|
||||
void restoreMacOSMpvFocusAfterModalClose({
|
||||
platform: process.platform,
|
||||
focusMpv: async () => {
|
||||
app.hide();
|
||||
},
|
||||
getWindowTracker: () => appState.windowTracker,
|
||||
updateVisibleOverlayVisibility: () =>
|
||||
overlayVisibilityRuntime.updateVisibleOverlayVisibility(),
|
||||
warn: (message, details) => logger.warn(message, details),
|
||||
});
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
createAppState,
|
||||
}) as BootServices;
|
||||
@@ -1715,7 +1681,7 @@ function syncOverlayMpvSubtitleSuppression(): void {
|
||||
restoreOverlayMpvSubtitles();
|
||||
}
|
||||
|
||||
const buildImmersionMediaRuntimeMainDepsHandler = createBuildImmersionMediaRuntimeMainDepsHandler({
|
||||
const immersionMediaRuntime = createImmersionMediaRuntime({
|
||||
getResolvedConfig: () => configService.getConfig(),
|
||||
defaultImmersionDbPath: DEFAULT_IMMERSION_DB_PATH,
|
||||
getTracker: () => appState.immersionTracker,
|
||||
@@ -1725,7 +1691,23 @@ const buildImmersionMediaRuntimeMainDepsHandler = createBuildImmersionMediaRunti
|
||||
logDebug: (message) => logger.debug(message),
|
||||
logInfo: (message) => logger.info(message),
|
||||
});
|
||||
const buildAnilistStateRuntimeMainDepsHandler = createBuildAnilistStateRuntimeMainDepsHandler({
|
||||
const anilistRateLimiter = createAnilistRateLimiter();
|
||||
const statsCoverArtFetcher = createCoverArtFetcher(
|
||||
anilistRateLimiter,
|
||||
createLogger('main:stats-cover-art'),
|
||||
{
|
||||
liveAction: createLiveActionMetadataResolver(
|
||||
createTmdbClient({
|
||||
resolveApiKey: createTmdbApiKeyResolver(
|
||||
() => configService.getConfig().tmdb,
|
||||
() => bundledTmdbApiKey,
|
||||
),
|
||||
}),
|
||||
createLogger('main:tmdb'),
|
||||
),
|
||||
},
|
||||
);
|
||||
const anilistStateRuntime = createAnilistStateRuntime({
|
||||
getClientSecretState: () => appState.anilistClientSecretState,
|
||||
setClientSecretState: (next) => {
|
||||
appState.anilistClientSecretState = transitionAnilistClientSecretState(
|
||||
@@ -1746,14 +1728,14 @@ const buildAnilistStateRuntimeMainDepsHandler = createBuildAnilistStateRuntimeMa
|
||||
anilistCachedAccessToken = null;
|
||||
},
|
||||
});
|
||||
const buildConfigDerivedRuntimeMainDepsHandler = createBuildConfigDerivedRuntimeMainDepsHandler({
|
||||
const configDerivedRuntime = createConfigDerivedRuntime({
|
||||
getResolvedConfig: () => configService.getConfig(),
|
||||
getRuntimeOptionsManager: () => appState.runtimeOptionsManager,
|
||||
defaultJimakuLanguagePreference: DEFAULT_CONFIG.jimaku.languagePreference,
|
||||
defaultJimakuMaxEntryResults: DEFAULT_CONFIG.jimaku.maxEntryResults,
|
||||
defaultJimakuApiBaseUrl: DEFAULT_CONFIG.jimaku.apiBaseUrl,
|
||||
});
|
||||
const buildMainSubsyncRuntimeMainDepsHandler = createBuildMainSubsyncRuntimeMainDepsHandler({
|
||||
const subsyncRuntime = createMainSubsyncRuntime({
|
||||
getMpvClient: () => appState.mpvClient,
|
||||
getResolvedConfig: () => configService.getConfig(),
|
||||
getSubsyncInProgress: () => appState.subsyncInProgress,
|
||||
@@ -1769,28 +1751,6 @@ const buildMainSubsyncRuntimeMainDepsHandler = createBuildMainSubsyncRuntimeMain
|
||||
);
|
||||
},
|
||||
});
|
||||
const immersionMediaRuntime = createImmersionMediaRuntime(
|
||||
buildImmersionMediaRuntimeMainDepsHandler(),
|
||||
);
|
||||
const anilistRateLimiter = createAnilistRateLimiter();
|
||||
const statsCoverArtFetcher = createCoverArtFetcher(
|
||||
anilistRateLimiter,
|
||||
createLogger('main:stats-cover-art'),
|
||||
{
|
||||
liveAction: createLiveActionMetadataResolver(
|
||||
createTmdbClient({
|
||||
resolveApiKey: createTmdbApiKeyResolver(
|
||||
() => configService.getConfig().tmdb,
|
||||
() => bundledTmdbApiKey,
|
||||
),
|
||||
}),
|
||||
createLogger('main:tmdb'),
|
||||
),
|
||||
},
|
||||
);
|
||||
const anilistStateRuntime = createAnilistStateRuntime(buildAnilistStateRuntimeMainDepsHandler());
|
||||
const configDerivedRuntime = createConfigDerivedRuntime(buildConfigDerivedRuntimeMainDepsHandler());
|
||||
const subsyncRuntime = createMainSubsyncRuntime(buildMainSubsyncRuntimeMainDepsHandler());
|
||||
const currentMediaTokenizationGate = createCurrentMediaTokenizationGate();
|
||||
const startupOsdSequencer = createStartupOsdSequencer({
|
||||
getNotificationType: () => overlayNotificationsRuntime.getConfiguredStatusNotificationType(),
|
||||
@@ -1937,7 +1897,10 @@ let tokenizeSubtitleDeferred: ((text: string) => Promise<SubtitleData>) | null =
|
||||
function withCurrentSubtitleTiming(payload: SubtitleData): SubtitleData {
|
||||
const canonical = resolveCanonicalPrimarySubtitle({
|
||||
liveText: payload.text,
|
||||
currentTimeSec: Number(appState.mpvClient?.currentTimePos),
|
||||
currentTimeSec: toSubtitleClock(
|
||||
Number(appState.mpvClient?.currentTimePos),
|
||||
appState.mpvClient?.currentSubDelay ?? 0,
|
||||
),
|
||||
cues: appState.activeParsedSubtitleCues,
|
||||
});
|
||||
return {
|
||||
@@ -1951,9 +1914,11 @@ function captureCurrentPrimarySubtitleMiningContext(): SubtitleMiningContext | n
|
||||
// Mine what the overlay shows, not raw mpv `sub-text`: the raw text lists every active
|
||||
// event, so a finished caption row lingering beside a fresh line would end up on the
|
||||
// card. The parsed view also carries the cue's own timings for the clip range.
|
||||
// Cues sit on the subtitle clock, so the lookup undoes `sub-delay` first.
|
||||
const subDelay = appState.mpvClient?.currentSubDelay ?? 0;
|
||||
const resolved = resolvePrimarySubtitle({
|
||||
liveText: appState.mpvClient?.currentSubText ?? '',
|
||||
currentTimeSec: Number(appState.mpvClient?.currentTimePos),
|
||||
currentTimeSec: toSubtitleClock(Number(appState.mpvClient?.currentTimePos), subDelay),
|
||||
cues: appState.activeParsedSubtitleCues,
|
||||
});
|
||||
// Same validity bar as the live capture path: an unusable resolved span must fall
|
||||
@@ -1968,13 +1933,16 @@ function captureCurrentPrimarySubtitleMiningContext(): SubtitleMiningContext | n
|
||||
) {
|
||||
return captureLiveSubtitleMiningContext(appState.mpvClient);
|
||||
}
|
||||
return {
|
||||
source: 'overlay',
|
||||
text: resolvedText,
|
||||
startTime: resolved.startTime,
|
||||
endTime: resolved.endTime,
|
||||
capturedAtMs: Date.now(),
|
||||
};
|
||||
return shiftSubtitleRangeToVideoClock<SubtitleMiningContext>(
|
||||
{
|
||||
source: 'overlay',
|
||||
text: resolvedText,
|
||||
startTime: resolved.startTime,
|
||||
endTime: resolved.endTime,
|
||||
capturedAtMs: Date.now(),
|
||||
},
|
||||
subDelay,
|
||||
);
|
||||
}
|
||||
function emitSubtitlePayload(payload: SubtitleData, options?: { resumePrefetch?: boolean }): void {
|
||||
const timedPayload = withCurrentSubtitleTiming(payload);
|
||||
@@ -2051,30 +2019,18 @@ function signalCurrentSubtitleAutoplayReady(): void {
|
||||
);
|
||||
}
|
||||
}
|
||||
const buildSubtitleProcessingControllerMainDepsHandler =
|
||||
createBuildSubtitleProcessingControllerMainDepsHandler({
|
||||
tokenizeSubtitle: async (text: string) =>
|
||||
tokenizeSubtitleDeferred ? await tokenizeSubtitleDeferred(text) : { text, tokens: null },
|
||||
// Controller emits never release the prefetch pause: the first emit for an
|
||||
// uncached line is the provisional plain payload, sent before tokenization
|
||||
// starts, so resuming on it would put prefetch back in contention with the
|
||||
// on-screen line for the single parser window.
|
||||
emitSubtitle: (payload) => emitSubtitlePayload(payload, { resumePrefetch: false }),
|
||||
// The pause is released once the controller has no work left, which covers
|
||||
// the runs that end without an emit (suppressed duplicate, failed
|
||||
// tokenization) as well as the ones that deliver a payload.
|
||||
onProcessingSettled: () => {
|
||||
subtitlePrefetchService?.resume();
|
||||
},
|
||||
logDebug: (message) => {
|
||||
logger.debug(`[subtitle-processing] ${message}`);
|
||||
},
|
||||
now: () => Date.now(),
|
||||
});
|
||||
const subtitleProcessingControllerMainDeps = buildSubtitleProcessingControllerMainDepsHandler();
|
||||
const subtitleProcessingController = createSubtitleProcessingController(
|
||||
subtitleProcessingControllerMainDeps,
|
||||
);
|
||||
const subtitleProcessingController = createPrefetchAwareSubtitleProcessingController({
|
||||
tokenizeSubtitle: async (text: string) =>
|
||||
tokenizeSubtitleDeferred ? await tokenizeSubtitleDeferred(text) : { text, tokens: null },
|
||||
emitSubtitlePayload: (payload, options) => emitSubtitlePayload(payload, options),
|
||||
resumePrefetch: () => {
|
||||
subtitlePrefetchService?.resume();
|
||||
},
|
||||
logDebug: (message) => {
|
||||
logger.debug(`[subtitle-processing] ${message}`);
|
||||
},
|
||||
now: () => Date.now(),
|
||||
});
|
||||
|
||||
let subtitlePrefetchService: SubtitlePrefetchService | null = null;
|
||||
let lastObservedTimePos = 0;
|
||||
@@ -2116,13 +2072,18 @@ function getSubtitleSidebarPlaybackState(): SubtitleSidebarPlaybackState {
|
||||
subtitleSidebarCuesRef = appState.activeParsedSubtitleCues;
|
||||
subtitleSidebarCuesRevision += 1;
|
||||
}
|
||||
const subDelay = appState.mpvClient?.currentSubDelay ?? 0;
|
||||
return {
|
||||
sourceKey: JSON.stringify([
|
||||
appState.activeParsedSubtitleMediaPath,
|
||||
appState.activeParsedSubtitleSource,
|
||||
]),
|
||||
cuesRevision: subtitleSidebarCuesRevision,
|
||||
currentTimeSec: appState.mpvClient?.currentTimePos ?? null,
|
||||
currentTimeSec:
|
||||
appState.mpvClient?.currentTimePos === undefined
|
||||
? null
|
||||
: toSubtitleClock(appState.mpvClient.currentTimePos, subDelay),
|
||||
subDelay,
|
||||
currentSubtitle: {
|
||||
text: appState.currentSubText,
|
||||
startTime: appState.mpvClient?.currentSubStart ?? null,
|
||||
@@ -2161,6 +2122,7 @@ function sendRendererMpvCommand(rawCommand: (string | number)[]): void {
|
||||
rawCommand,
|
||||
appState.activeParsedSubtitleCues,
|
||||
appState.mpvClient?.currentTimePos ?? Number.NaN,
|
||||
appState.mpvClient?.currentSubDelay ?? 0,
|
||||
) ?? rawCommand;
|
||||
if (isExplicitMpvSeekCommand(command)) {
|
||||
explicitSeekIntentExpiresAtMs = Date.now() + EXPLICIT_SEEK_INTENT_TTL_MS;
|
||||
@@ -2629,79 +2591,68 @@ const frequencyDictionaryRuntime = createFrequencyDictionaryRuntimeService(
|
||||
})(),
|
||||
);
|
||||
|
||||
const buildGetFieldGroupingResolverMainDepsHandler =
|
||||
createBuildGetFieldGroupingResolverMainDepsHandler({
|
||||
getResolver: () => appState.fieldGroupingResolver,
|
||||
});
|
||||
const getFieldGroupingResolverMainDeps = buildGetFieldGroupingResolverMainDepsHandler();
|
||||
const getFieldGroupingResolverHandler = createGetFieldGroupingResolverHandler(
|
||||
getFieldGroupingResolverMainDeps,
|
||||
);
|
||||
const getFieldGroupingResolverHandler = createGetFieldGroupingResolverHandler({
|
||||
getResolver: () => appState.fieldGroupingResolver,
|
||||
});
|
||||
|
||||
const buildSetFieldGroupingResolverMainDepsHandler =
|
||||
createBuildSetFieldGroupingResolverMainDepsHandler({
|
||||
setResolver: (resolver) => {
|
||||
appState.fieldGroupingResolver = resolver;
|
||||
},
|
||||
nextSequence: () => {
|
||||
appState.fieldGroupingResolverSequence += 1;
|
||||
return appState.fieldGroupingResolverSequence;
|
||||
},
|
||||
getSequence: () => appState.fieldGroupingResolverSequence,
|
||||
});
|
||||
const setFieldGroupingResolverMainDeps = buildSetFieldGroupingResolverMainDepsHandler();
|
||||
const setFieldGroupingResolverHandler = createSetFieldGroupingResolverHandler(
|
||||
setFieldGroupingResolverMainDeps,
|
||||
);
|
||||
const setFieldGroupingResolverHandler = createSetFieldGroupingResolverHandler({
|
||||
setResolver: (resolver) => {
|
||||
appState.fieldGroupingResolver = resolver;
|
||||
},
|
||||
nextSequence: () => {
|
||||
appState.fieldGroupingResolverSequence += 1;
|
||||
return appState.fieldGroupingResolverSequence;
|
||||
},
|
||||
getSequence: () => appState.fieldGroupingResolverSequence,
|
||||
});
|
||||
|
||||
const fieldGroupingOverlayRuntime = createFieldGroupingOverlayRuntime<OverlayHostedModal>(
|
||||
createBuildFieldGroupingOverlayMainDepsHandler<OverlayHostedModal>({
|
||||
getMainWindow: () => overlayManager.getMainWindow(),
|
||||
getVisibleOverlayVisible: () => overlayManager.getVisibleOverlayVisible(),
|
||||
setVisibleOverlayVisible: (visible) => setVisibleOverlayVisible(visible),
|
||||
getResolver: () => getFieldGroupingResolverHandler(),
|
||||
setResolver: (resolver) => setFieldGroupingResolverHandler(resolver),
|
||||
getRestoreVisibleOverlayOnModalClose: () =>
|
||||
overlayModalRuntime.getRestoreVisibleOverlayOnModalClose(),
|
||||
waitForModalOpen: (modal, timeoutMs) => overlayModalRuntime.waitForModalOpen(modal, timeoutMs),
|
||||
handleOverlayModalClosed: (modal) => overlayModalRuntime.handleOverlayModalClosed(modal),
|
||||
logWarn: (message) => logger.warn(message),
|
||||
ensureOverlayStartupPrereqs: () => ensureOverlayStartupPrereqs(),
|
||||
ensureOverlayWindowsReadyForVisibilityActions: () =>
|
||||
ensureOverlayWindowsReadyForVisibilityActions(),
|
||||
sendToActiveOverlayWindow: (channel, payload, runtimeOptions) =>
|
||||
overlayModalRuntime.sendToActiveOverlayWindow(channel, payload, runtimeOptions),
|
||||
})(),
|
||||
);
|
||||
const fieldGroupingOverlayRuntime = createFieldGroupingOverlayRuntime<OverlayHostedModal>({
|
||||
getMainWindow: () => overlayManager.getMainWindow(),
|
||||
getVisibleOverlayVisible: () => overlayManager.getVisibleOverlayVisible(),
|
||||
setVisibleOverlayVisible: (visible) => setVisibleOverlayVisible(visible),
|
||||
getResolver: () => getFieldGroupingResolverHandler(),
|
||||
setResolver: (resolver) => setFieldGroupingResolverHandler(resolver),
|
||||
getRestoreVisibleOverlayOnModalClose: () =>
|
||||
overlayModalRuntime.getRestoreVisibleOverlayOnModalClose(),
|
||||
// These are optional on the runtime options, so a missing forward compiles silently, but
|
||||
// dropping them leaves the field grouping modal with no modal-open ack/retry, no teardown on
|
||||
// failure, and no warn logging.
|
||||
waitForModalOpen: (modal, timeoutMs) => overlayModalRuntime.waitForModalOpen(modal, timeoutMs),
|
||||
handleOverlayModalClosed: (modal) => overlayModalRuntime.handleOverlayModalClosed(modal),
|
||||
logWarn: (message) => logger.warn(message),
|
||||
ensureOverlayStartupPrereqs: () => ensureOverlayStartupPrereqs(),
|
||||
ensureOverlayWindowsReadyForVisibilityActions: () =>
|
||||
ensureOverlayWindowsReadyForVisibilityActions(),
|
||||
sendToVisibleOverlay: (channel, payload, runtimeOptions) =>
|
||||
overlayModalRuntime.sendToActiveOverlayWindow(channel, payload, runtimeOptions),
|
||||
});
|
||||
const createFieldGroupingCallback = fieldGroupingOverlayRuntime.createFieldGroupingCallback;
|
||||
|
||||
const SUBTITLE_POSITIONS_DIR = path.join(CONFIG_DIR, 'subtitle-positions');
|
||||
|
||||
const mediaRuntime = createMediaRuntimeService(
|
||||
createBuildMediaRuntimeMainDepsHandler({
|
||||
isRemoteMediaPath: (mediaPath) => isRemoteMediaPath(mediaPath),
|
||||
loadSubtitlePosition: () => loadSubtitlePosition(),
|
||||
getCurrentMediaPath: () => appState.currentMediaPath,
|
||||
getPendingSubtitlePosition: () => appState.pendingSubtitlePosition,
|
||||
getSubtitlePositionsDir: () => SUBTITLE_POSITIONS_DIR,
|
||||
setCurrentMediaPath: (nextPath: string | null) => {
|
||||
appState.currentMediaPath = nextPath;
|
||||
},
|
||||
clearPendingSubtitlePosition: () => {
|
||||
appState.pendingSubtitlePosition = null;
|
||||
},
|
||||
setSubtitlePosition: (position: SubtitlePosition | null) => {
|
||||
appState.subtitlePosition = position;
|
||||
},
|
||||
broadcastToOverlayWindows: (channel, payload) => {
|
||||
overlayManager.broadcastToOverlayWindows(channel, payload);
|
||||
},
|
||||
getCurrentMediaTitle: () => appState.currentMediaTitle,
|
||||
setCurrentMediaTitle: (title) => {
|
||||
appState.currentMediaTitle = title;
|
||||
},
|
||||
})(),
|
||||
);
|
||||
const mediaRuntime = createMediaRuntimeService({
|
||||
isRemoteMediaPath: (mediaPath) => isRemoteMediaPath(mediaPath),
|
||||
loadSubtitlePosition: () => loadSubtitlePosition(),
|
||||
getCurrentMediaPath: () => appState.currentMediaPath,
|
||||
getPendingSubtitlePosition: () => appState.pendingSubtitlePosition,
|
||||
getSubtitlePositionsDir: () => SUBTITLE_POSITIONS_DIR,
|
||||
setCurrentMediaPath: (nextPath: string | null) => {
|
||||
appState.currentMediaPath = nextPath;
|
||||
},
|
||||
clearPendingSubtitlePosition: () => {
|
||||
appState.pendingSubtitlePosition = null;
|
||||
},
|
||||
setSubtitlePosition: (position: SubtitlePosition | null) => {
|
||||
appState.subtitlePosition = position;
|
||||
},
|
||||
broadcastSubtitlePosition: (position) => {
|
||||
overlayManager.broadcastToOverlayWindows('subtitle-position:set', position);
|
||||
},
|
||||
getCurrentMediaTitle: () => appState.currentMediaTitle,
|
||||
setCurrentMediaTitle: (title) => {
|
||||
appState.currentMediaTitle = title;
|
||||
},
|
||||
});
|
||||
|
||||
const characterDictionaryRuntime = createCharacterDictionaryRuntimeService({
|
||||
userDataPath: USER_DATA_PATH,
|
||||
@@ -2977,20 +2928,10 @@ const visibleOverlayInteractionRuntime = createVisibleOverlayInteractionRuntime(
|
||||
getOverlayForegroundSeparateWindows: () => getOverlayForegroundSeparateWindows(),
|
||||
});
|
||||
|
||||
const buildGetRuntimeOptionsStateMainDepsHandler = createBuildGetRuntimeOptionsStateMainDepsHandler(
|
||||
{
|
||||
getRuntimeOptionsManager: () => appState.runtimeOptionsManager,
|
||||
},
|
||||
);
|
||||
const getRuntimeOptionsStateMainDeps = buildGetRuntimeOptionsStateMainDepsHandler();
|
||||
const getRuntimeOptionsStateHandler = createGetRuntimeOptionsStateHandler(
|
||||
getRuntimeOptionsStateMainDeps,
|
||||
);
|
||||
const getRuntimeOptionsStateHandler = createGetRuntimeOptionsStateHandler({
|
||||
getRuntimeOptionsManager: () => appState.runtimeOptionsManager,
|
||||
});
|
||||
|
||||
const buildRestorePreviousSecondarySubVisibilityMainDepsHandler =
|
||||
createBuildRestorePreviousSecondarySubVisibilityMainDepsHandler({
|
||||
getMpvClient: () => appState.mpvClient,
|
||||
});
|
||||
syncOverlayVisibilityForModal = () => {
|
||||
overlayVisibilityRuntime.updateVisibleOverlayVisibility();
|
||||
};
|
||||
@@ -3015,42 +2956,31 @@ const {
|
||||
maybeStartOverlayLoadingOsd,
|
||||
} = overlayNotificationsRuntime;
|
||||
|
||||
const buildBroadcastRuntimeOptionsChangedMainDepsHandler =
|
||||
createBuildBroadcastRuntimeOptionsChangedMainDepsHandler({
|
||||
const overlayVisibilityComposer = composeOverlayVisibilityRuntime({
|
||||
overlayVisibilityRuntime,
|
||||
restorePreviousSecondarySubVisibilityMainDeps: {
|
||||
getMpvClient: () => appState.mpvClient,
|
||||
},
|
||||
broadcastRuntimeOptionsChangedMainDeps: {
|
||||
broadcastRuntimeOptionsChangedRuntime,
|
||||
getRuntimeOptionsState: () => getRuntimeOptionsStateHandler(),
|
||||
broadcastToOverlayWindows: (channel, ...args) =>
|
||||
overlayManager.broadcastToOverlayWindows(channel, ...args),
|
||||
});
|
||||
|
||||
const buildSendToActiveOverlayWindowMainDepsHandler =
|
||||
createBuildSendToActiveOverlayWindowMainDepsHandler({
|
||||
},
|
||||
sendToActiveOverlayWindowMainDeps: {
|
||||
sendToActiveOverlayWindowRuntime: (channel, payload, runtimeOptions) =>
|
||||
overlayModalRuntime.sendToActiveOverlayWindow(channel, payload, runtimeOptions),
|
||||
});
|
||||
|
||||
const buildSetOverlayDebugVisualizationEnabledMainDepsHandler =
|
||||
createBuildSetOverlayDebugVisualizationEnabledMainDepsHandler({
|
||||
},
|
||||
setOverlayDebugVisualizationEnabledMainDeps: {
|
||||
setOverlayDebugVisualizationEnabledRuntime,
|
||||
getCurrentEnabled: () => appState.overlayDebugVisualizationEnabled,
|
||||
setCurrentEnabled: (next) => {
|
||||
appState.overlayDebugVisualizationEnabled = next;
|
||||
},
|
||||
});
|
||||
|
||||
const buildOpenRuntimeOptionsPaletteMainDepsHandler =
|
||||
createBuildOpenRuntimeOptionsPaletteMainDepsHandler({
|
||||
},
|
||||
openRuntimeOptionsPaletteMainDeps: {
|
||||
openRuntimeOptionsPaletteRuntime: () => overlayModalRuntime.openRuntimeOptionsPalette(),
|
||||
});
|
||||
const overlayVisibilityComposer = composeOverlayVisibilityRuntime({
|
||||
overlayVisibilityRuntime,
|
||||
restorePreviousSecondarySubVisibilityMainDeps:
|
||||
buildRestorePreviousSecondarySubVisibilityMainDepsHandler(),
|
||||
broadcastRuntimeOptionsChangedMainDeps: buildBroadcastRuntimeOptionsChangedMainDepsHandler(),
|
||||
sendToActiveOverlayWindowMainDeps: buildSendToActiveOverlayWindowMainDepsHandler(),
|
||||
setOverlayDebugVisualizationEnabledMainDeps:
|
||||
buildSetOverlayDebugVisualizationEnabledMainDepsHandler(),
|
||||
openRuntimeOptionsPaletteMainDeps: buildOpenRuntimeOptionsPaletteMainDepsHandler(),
|
||||
},
|
||||
});
|
||||
|
||||
function createOverlayHostedModalOpenDeps(): {
|
||||
@@ -3115,7 +3045,10 @@ const mediaTimingReviewRuntime = createMediaTimingReviewRuntime({
|
||||
acquireMediaWindow: (source, range) => getSharedRemoteMediaWindowCache().acquire(source, range),
|
||||
getSubtitleContextLines: (range) =>
|
||||
collectMediaTimingContextLines({
|
||||
cues: appState.activeParsedSubtitleCues,
|
||||
// Review ranges and tracker entries are on the video clock; parsed cues are not.
|
||||
cues: appState.activeParsedSubtitleCues.map((cue) =>
|
||||
shiftSubtitleRangeToVideoClock(cue, appState.mpvClient?.currentSubDelay ?? 0),
|
||||
),
|
||||
fallbackPrevious: appState.subtitleTimingTracker?.getRecentEntries(40) ?? [],
|
||||
startTime: range.startTime,
|
||||
endTime: range.endTime,
|
||||
@@ -3862,56 +3795,50 @@ const {
|
||||
const maybeFocusExistingAnilistSetupWindow = createMaybeFocusExistingAnilistSetupWindowHandler({
|
||||
getSetupWindow: () => appState.anilistSetupWindow,
|
||||
});
|
||||
const buildOpenAnilistSetupWindowMainDepsHandler = createBuildOpenAnilistSetupWindowMainDepsHandler(
|
||||
{
|
||||
maybeFocusExistingSetupWindow: maybeFocusExistingAnilistSetupWindow,
|
||||
createSetupWindow: createCreateAnilistSetupWindowHandler({
|
||||
createBrowserWindow: (options) => new BrowserWindow(options),
|
||||
const openAnilistSetupWindowHandler = createOpenAnilistSetupWindowHandler({
|
||||
maybeFocusExistingSetupWindow: maybeFocusExistingAnilistSetupWindow,
|
||||
createSetupWindow: createCreateAnilistSetupWindowHandler({
|
||||
createBrowserWindow: (options) => new BrowserWindow(options),
|
||||
}),
|
||||
buildAuthorizeUrl: () =>
|
||||
buildAnilistSetupUrl({
|
||||
authorizeUrl: ANILIST_SETUP_CLIENT_ID_URL,
|
||||
clientId: ANILIST_DEFAULT_CLIENT_ID,
|
||||
responseType: ANILIST_SETUP_RESPONSE_TYPE,
|
||||
}),
|
||||
buildAuthorizeUrl: () =>
|
||||
buildAnilistSetupUrl({
|
||||
authorizeUrl: ANILIST_SETUP_CLIENT_ID_URL,
|
||||
clientId: ANILIST_DEFAULT_CLIENT_ID,
|
||||
responseType: ANILIST_SETUP_RESPONSE_TYPE,
|
||||
}),
|
||||
consumeCallbackUrl: (rawUrl) => consumeAnilistSetupTokenFromUrl(rawUrl),
|
||||
openSetupInBrowser: (authorizeUrl) =>
|
||||
openAnilistSetupInBrowser({
|
||||
authorizeUrl,
|
||||
openExternal: (url) => shell.openExternal(url),
|
||||
logError: (message, error) => logger.error(message, error),
|
||||
}),
|
||||
loadManualTokenEntry: (setupWindow, authorizeUrl) =>
|
||||
loadAnilistManualTokenEntry({
|
||||
setupWindow: setupWindow as BrowserWindow,
|
||||
authorizeUrl,
|
||||
developerSettingsUrl: ANILIST_DEVELOPER_SETTINGS_URL,
|
||||
logWarn: (message, data) => logger.warn(message, data),
|
||||
}),
|
||||
redirectUri: ANILIST_REDIRECT_URI,
|
||||
developerSettingsUrl: ANILIST_DEVELOPER_SETTINGS_URL,
|
||||
isAllowedExternalUrl: (url) => isAllowedAnilistExternalUrl(url),
|
||||
isAllowedNavigationUrl: (url) => isAllowedAnilistSetupNavigationUrl(url),
|
||||
logWarn: (message, details) => logger.warn(message, details),
|
||||
logError: (message, details) => logger.error(message, details),
|
||||
clearSetupWindow: () => {
|
||||
appState.anilistSetupWindow = null;
|
||||
},
|
||||
setSetupPageOpened: (opened) => {
|
||||
appState.anilistSetupPageOpened = opened;
|
||||
},
|
||||
setSetupWindow: (setupWindow) => {
|
||||
appState.anilistSetupWindow = setupWindow as BrowserWindow;
|
||||
},
|
||||
openExternal: (url) => {
|
||||
void shell.openExternal(url);
|
||||
},
|
||||
consumeCallbackUrl: (rawUrl) => consumeAnilistSetupTokenFromUrl(rawUrl),
|
||||
openSetupInBrowser: (authorizeUrl) =>
|
||||
openAnilistSetupInBrowser({
|
||||
authorizeUrl,
|
||||
openExternal: (url) => shell.openExternal(url),
|
||||
logError: (message, error) => logger.error(message, error),
|
||||
}),
|
||||
loadManualTokenEntry: (setupWindow, authorizeUrl) =>
|
||||
loadAnilistManualTokenEntry({
|
||||
setupWindow: setupWindow as BrowserWindow,
|
||||
authorizeUrl,
|
||||
developerSettingsUrl: ANILIST_DEVELOPER_SETTINGS_URL,
|
||||
logWarn: (message, data) => logger.warn(message, data),
|
||||
}),
|
||||
redirectUri: ANILIST_REDIRECT_URI,
|
||||
developerSettingsUrl: ANILIST_DEVELOPER_SETTINGS_URL,
|
||||
isAllowedExternalUrl: (url) => isAllowedAnilistExternalUrl(url),
|
||||
isAllowedNavigationUrl: (url) => isAllowedAnilistSetupNavigationUrl(url),
|
||||
logWarn: (message, details) => logger.warn(message, details),
|
||||
logError: (message, details) => logger.error(message, details),
|
||||
clearSetupWindow: () => {
|
||||
appState.anilistSetupWindow = null;
|
||||
},
|
||||
);
|
||||
|
||||
const openAnilistSetupWindowHandler = createOpenAnilistSetupWindowHandler(
|
||||
buildOpenAnilistSetupWindowMainDepsHandler(),
|
||||
);
|
||||
setSetupPageOpened: (opened) => {
|
||||
appState.anilistSetupPageOpened = opened;
|
||||
},
|
||||
setSetupWindow: (setupWindow) => {
|
||||
appState.anilistSetupWindow = setupWindow as BrowserWindow;
|
||||
},
|
||||
openExternal: (url) => {
|
||||
void shell.openExternal(url);
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
refreshAnilistClientSecretState,
|
||||
@@ -4172,7 +4099,7 @@ const rememberAnilistAttemptedUpdate = (key: string): void => {
|
||||
);
|
||||
};
|
||||
|
||||
const buildLoadSubtitlePositionMainDepsHandler = createBuildLoadSubtitlePositionMainDepsHandler({
|
||||
const loadSubtitlePosition = createLoadSubtitlePositionHandler({
|
||||
loadSubtitlePositionCore: () =>
|
||||
loadSubtitlePositionCore({
|
||||
currentMediaPath: appState.currentMediaPath,
|
||||
@@ -4183,10 +4110,8 @@ const buildLoadSubtitlePositionMainDepsHandler = createBuildLoadSubtitlePosition
|
||||
appState.subtitlePosition = position;
|
||||
},
|
||||
});
|
||||
const loadSubtitlePositionMainDeps = buildLoadSubtitlePositionMainDepsHandler();
|
||||
const loadSubtitlePosition = createLoadSubtitlePositionHandler(loadSubtitlePositionMainDeps);
|
||||
|
||||
const buildSaveSubtitlePositionMainDepsHandler = createBuildSaveSubtitlePositionMainDepsHandler({
|
||||
const saveSubtitlePosition = createSaveSubtitlePositionHandler({
|
||||
saveSubtitlePositionCore: (position) => {
|
||||
saveSubtitlePositionCore({
|
||||
position,
|
||||
@@ -4204,8 +4129,6 @@ const buildSaveSubtitlePositionMainDepsHandler = createBuildSaveSubtitlePosition
|
||||
appState.subtitlePosition = position;
|
||||
},
|
||||
});
|
||||
const saveSubtitlePositionMainDeps = buildSaveSubtitlePositionMainDepsHandler();
|
||||
const saveSubtitlePosition = createSaveSubtitlePositionHandler(saveSubtitlePositionMainDeps);
|
||||
|
||||
registerSubminerProtocolClient();
|
||||
let flushPendingMpvLogWrites = (): void => {};
|
||||
@@ -4358,9 +4281,7 @@ const resolveLegacyVocabularyPos = async (row: {
|
||||
return null;
|
||||
};
|
||||
|
||||
const immersionTrackerStartupMainDeps: Parameters<
|
||||
typeof createBuildImmersionTrackerStartupMainDepsHandler
|
||||
>[0] = {
|
||||
const immersionTrackerStartupMainDeps: ImmersionTrackerStartupDeps = {
|
||||
getResolvedConfig: () => configService.getConfig(),
|
||||
getConfiguredDbPath: () => immersionMediaRuntime.getConfiguredDbPath(),
|
||||
createTrackerService: (params) =>
|
||||
@@ -4418,7 +4339,7 @@ const immersionTrackerStartupMainDeps: Parameters<
|
||||
logWarn: (message, details) => logger.warn(message, details),
|
||||
};
|
||||
const createImmersionTrackerStartup = createImmersionTrackerStartupHandler(
|
||||
createBuildImmersionTrackerStartupMainDepsHandler(immersionTrackerStartupMainDeps)(),
|
||||
immersionTrackerStartupMainDeps,
|
||||
);
|
||||
const recordSubtitleMiningContext = (context: SubtitleMiningContext | null): void => {
|
||||
pendingSubtitleMiningContext = context;
|
||||
@@ -5519,8 +5440,8 @@ const {
|
||||
buildRegisterGlobalShortcutsMainDeps: (getConfiguredShortcutsHandler) => ({
|
||||
getConfiguredShortcuts: () => getConfiguredShortcutsHandler(),
|
||||
registerGlobalShortcutsCore,
|
||||
toggleVisibleOverlay: () => toggleVisibleOverlay(),
|
||||
openYomitanSettings: () => openDictionarySettings(),
|
||||
onToggleVisibleOverlay: () => toggleVisibleOverlay(),
|
||||
onOpenYomitanSettings: () => openDictionarySettings(),
|
||||
isDev,
|
||||
getMainWindow: () => overlayManager.getMainWindow(),
|
||||
}),
|
||||
@@ -5649,8 +5570,8 @@ const cycleSecondarySubMode = createCycleSecondarySubModeRuntimeHandler({
|
||||
setLastSecondarySubToggleAtMs: (timestampMs: number) => {
|
||||
appState.lastSecondarySubToggleAtMs = timestampMs;
|
||||
},
|
||||
broadcastToOverlayWindows: (channel, mode) => {
|
||||
overlayManager.broadcastToOverlayWindows(channel, mode);
|
||||
broadcastSecondarySubMode: (mode) => {
|
||||
overlayManager.broadcastToOverlayWindows('secondary-subtitle:mode', mode);
|
||||
},
|
||||
showMpvOsd: (text: string) => showConfiguredPlaybackFeedback(text),
|
||||
},
|
||||
@@ -5661,90 +5582,62 @@ function setSecondarySubMode(mode: SecondarySubMode): void {
|
||||
appState.secondarySubMode = mode;
|
||||
}
|
||||
|
||||
const buildUpdateLastCardFromClipboardMainDepsHandler =
|
||||
createBuildUpdateLastCardFromClipboardMainDepsHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
readClipboardText: () => clipboard.readText(),
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
updateLastCardFromClipboardCore,
|
||||
});
|
||||
const updateLastCardFromClipboardMainDeps = buildUpdateLastCardFromClipboardMainDepsHandler();
|
||||
const updateLastCardFromClipboardHandler = createUpdateLastCardFromClipboardHandler(
|
||||
updateLastCardFromClipboardMainDeps,
|
||||
);
|
||||
const updateLastCardFromClipboardHandler = createUpdateLastCardFromClipboardHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
readClipboardText: () => clipboard.readText(),
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
updateLastCardFromClipboardCore,
|
||||
});
|
||||
|
||||
const buildRefreshKnownWordCacheMainDepsHandler = createBuildRefreshKnownWordCacheMainDepsHandler({
|
||||
const refreshKnownWordCacheHandler = createRefreshKnownWordCacheHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
missingIntegrationMessage: 'AnkiConnect integration not enabled',
|
||||
});
|
||||
const refreshKnownWordCacheMainDeps = buildRefreshKnownWordCacheMainDepsHandler();
|
||||
const refreshKnownWordCacheHandler = createRefreshKnownWordCacheHandler(
|
||||
refreshKnownWordCacheMainDeps,
|
||||
);
|
||||
|
||||
const buildTriggerFieldGroupingMainDepsHandler = createBuildTriggerFieldGroupingMainDepsHandler({
|
||||
const triggerFieldGroupingHandler = createTriggerFieldGroupingHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
triggerFieldGroupingCore,
|
||||
});
|
||||
const triggerFieldGroupingMainDeps = buildTriggerFieldGroupingMainDepsHandler();
|
||||
const triggerFieldGroupingHandler = createTriggerFieldGroupingHandler(triggerFieldGroupingMainDeps);
|
||||
|
||||
const buildMarkLastCardAsAudioCardMainDepsHandler =
|
||||
createBuildMarkLastCardAsAudioCardMainDepsHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
markLastCardAsAudioCardCore,
|
||||
});
|
||||
const markLastCardAsAudioCardMainDeps = buildMarkLastCardAsAudioCardMainDepsHandler();
|
||||
const markLastCardAsAudioCardHandler = createMarkLastCardAsAudioCardHandler(
|
||||
markLastCardAsAudioCardMainDeps,
|
||||
);
|
||||
const markLastCardAsAudioCardHandler = createMarkLastCardAsAudioCardHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
markLastCardAsAudioCardCore,
|
||||
});
|
||||
|
||||
const buildMineSentenceCardMainDepsHandler = createBuildMineSentenceCardMainDepsHandler({
|
||||
const mineSentenceCardHandler = createMineSentenceCardHandler({
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
getMpvClient: () => appState.mpvClient,
|
||||
getPrimarySubtitle: () => captureCurrentPrimarySubtitleMiningContext(),
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
mineSentenceCardCore,
|
||||
});
|
||||
const mineSentenceCardHandler = createMineSentenceCardHandler(
|
||||
buildMineSentenceCardMainDepsHandler(),
|
||||
);
|
||||
|
||||
const buildHandleMultiCopyDigitMainDepsHandler = createBuildHandleMultiCopyDigitMainDepsHandler({
|
||||
const handleMultiCopyDigitHandler = createHandleMultiCopyDigitHandler({
|
||||
getSubtitleTimingTracker: () => appState.subtitleTimingTracker,
|
||||
writeClipboardText: (text) => clipboard.writeText(text),
|
||||
showMpvOsd: (text) => showConfiguredPlaybackFeedback(text),
|
||||
handleMultiCopyDigitCore,
|
||||
});
|
||||
const handleMultiCopyDigitMainDeps = buildHandleMultiCopyDigitMainDepsHandler();
|
||||
const handleMultiCopyDigitHandler = createHandleMultiCopyDigitHandler(handleMultiCopyDigitMainDeps);
|
||||
|
||||
const buildCopyCurrentSubtitleMainDepsHandler = createBuildCopyCurrentSubtitleMainDepsHandler({
|
||||
const copyCurrentSubtitleHandler = createCopyCurrentSubtitleHandler({
|
||||
getSubtitleTimingTracker: () => appState.subtitleTimingTracker,
|
||||
writeClipboardText: (text) => clipboard.writeText(text),
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
copyCurrentSubtitleCore,
|
||||
});
|
||||
const copyCurrentSubtitleMainDeps = buildCopyCurrentSubtitleMainDepsHandler();
|
||||
const copyCurrentSubtitleHandler = createCopyCurrentSubtitleHandler(copyCurrentSubtitleMainDeps);
|
||||
|
||||
const buildHandleMineSentenceDigitMainDepsHandler =
|
||||
createBuildHandleMineSentenceDigitMainDepsHandler({
|
||||
getSubtitleTimingTracker: () => appState.subtitleTimingTracker,
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
getCurrentSecondarySubText: () => appState.mpvClient?.currentSecondarySubText || undefined,
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
logError: (message, err) => {
|
||||
logger.error(message, err);
|
||||
},
|
||||
handleMineSentenceDigitCore,
|
||||
});
|
||||
const handleMineSentenceDigitMainDeps = buildHandleMineSentenceDigitMainDepsHandler();
|
||||
const handleMineSentenceDigitHandler = createHandleMineSentenceDigitHandler(
|
||||
handleMineSentenceDigitMainDeps,
|
||||
);
|
||||
const handleMineSentenceDigitHandler = createHandleMineSentenceDigitHandler({
|
||||
getSubtitleTimingTracker: () => appState.subtitleTimingTracker,
|
||||
getAnkiIntegration: () => appState.ankiIntegration,
|
||||
getCurrentSecondarySubText: () => appState.mpvClient?.currentSecondarySubText || undefined,
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
logError: (message, err) => {
|
||||
logger.error(message, err);
|
||||
},
|
||||
handleMineSentenceDigitCore,
|
||||
});
|
||||
const {
|
||||
setVisibleOverlayVisible: setVisibleOverlayVisibleHandler,
|
||||
toggleVisibleOverlay: toggleVisibleOverlayHandler,
|
||||
@@ -5760,29 +5653,19 @@ const {
|
||||
getVisibleOverlayVisible: () => overlayManager.getVisibleOverlayVisible(),
|
||||
});
|
||||
|
||||
const buildHandleOverlayModalClosedMainDepsHandler =
|
||||
createBuildHandleOverlayModalClosedMainDepsHandler({
|
||||
handleOverlayModalClosedRuntime: (modal) => overlayModalRuntime.handleOverlayModalClosed(modal),
|
||||
});
|
||||
const handleOverlayModalClosedMainDeps = buildHandleOverlayModalClosedMainDepsHandler();
|
||||
const handleOverlayModalClosedHandler = createHandleOverlayModalClosedHandler(
|
||||
handleOverlayModalClosedMainDeps,
|
||||
);
|
||||
const handleOverlayModalClosedHandler = createHandleOverlayModalClosedHandler({
|
||||
handleOverlayModalClosedRuntime: (modal) => overlayModalRuntime.handleOverlayModalClosed(modal),
|
||||
});
|
||||
|
||||
const buildAppendClipboardVideoToQueueMainDepsHandler =
|
||||
createBuildAppendClipboardVideoToQueueMainDepsHandler({
|
||||
appendClipboardVideoToQueueRuntime,
|
||||
getMpvClient: () => appState.mpvClient,
|
||||
readClipboardText: () => clipboard.readText(),
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
sendMpvCommand: (command) => {
|
||||
sendMpvCommandRuntime(appState.mpvClient, command);
|
||||
},
|
||||
});
|
||||
const appendClipboardVideoToQueueMainDeps = buildAppendClipboardVideoToQueueMainDepsHandler();
|
||||
const appendClipboardVideoToQueueHandler = createAppendClipboardVideoToQueueHandler(
|
||||
appendClipboardVideoToQueueMainDeps,
|
||||
);
|
||||
const appendClipboardVideoToQueueHandler = createAppendClipboardVideoToQueueHandler({
|
||||
appendClipboardVideoToQueueRuntime,
|
||||
getMpvClient: () => appState.mpvClient,
|
||||
readClipboardText: () => clipboard.readText(),
|
||||
showMpvOsd: (text) => overlayNotificationsRuntime.showConfiguredStatusNotification(text),
|
||||
sendMpvCommand: (command) => {
|
||||
sendMpvCommandRuntime(appState.mpvClient, command);
|
||||
},
|
||||
});
|
||||
|
||||
async function dispatchSessionAction(request: SessionActionDispatchRequest): Promise<void> {
|
||||
await dispatchSessionActionCore(request, {
|
||||
@@ -6028,7 +5911,11 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
|
||||
// live mpv sub timings at lookup time so media generation clips the mined line even
|
||||
// when extraction finishes long after playback has moved on.
|
||||
recordSubtitleMiningContext: (context) =>
|
||||
recordSubtitleMiningContext(context ?? captureCurrentPrimarySubtitleMiningContext()),
|
||||
recordSubtitleMiningContext(
|
||||
context
|
||||
? shiftSubtitleRangeToVideoClock(context, appState.mpvClient?.currentSubDelay ?? 0)
|
||||
: captureCurrentPrimarySubtitleMiningContext(),
|
||||
),
|
||||
tokenizeCurrentSubtitle: async () => {
|
||||
const tokenizeSubtitleForCurrent = tokenizeSubtitleDeferred;
|
||||
return resolveCurrentSubtitleForRenderer({
|
||||
|
||||
@@ -114,14 +114,22 @@ linuxTest('keepalive script releases the mount only after straggler processes ex
|
||||
fs.mkdirSync(mountDir);
|
||||
|
||||
// AppRun leaves behind a straggler that keeps executing *from the mount*
|
||||
// after AppRun itself exits — mimicking Chromium utility children.
|
||||
fs.copyFileSync('/usr/bin/sleep', path.join(mountDir, 'straggler'));
|
||||
fs.chmodSync(path.join(mountDir, 'straggler'), 0o755);
|
||||
// after AppRun itself exits — mimicking Chromium utility children. AppRun waits
|
||||
// until the straggler has exec'd, otherwise under load the supervisor can scan
|
||||
// /proc while the forked child is still /bin/sh and release the mount early.
|
||||
// The copy must keep the name `sleep`: multicall coreutils (uutils on Ubuntu
|
||||
// 26.04+, busybox) pick the utility from argv[0] and exit immediately otherwise.
|
||||
const stragglerPath = path.join(mountDir, 'sleep');
|
||||
fs.copyFileSync('/usr/bin/sleep', stragglerPath);
|
||||
fs.chmodSync(stragglerPath, 0o755);
|
||||
writeExecutable(
|
||||
path.join(mountDir, 'AppRun'),
|
||||
[
|
||||
'#!/bin/sh',
|
||||
`"${mountDir}/straggler" 1 &`,
|
||||
`"${stragglerPath}" 1 &`,
|
||||
'straggler=$!',
|
||||
// Bail out if the straggler dies early so the drain assertion reports it.
|
||||
`while kill -0 "$straggler" 2>/dev/null && [ "$(readlink "/proc/$straggler/exe")" != "${stragglerPath}" ]; do sleep 0.01; done`,
|
||||
`date +%s%N > "${resultsDir}/apprun-exited"`,
|
||||
'exit 42',
|
||||
].join('\n'),
|
||||
|
||||
@@ -52,13 +52,23 @@ if [ -z "$app_run" ]; then
|
||||
kill "$holder" 2>/dev/null
|
||||
run_direct "$@"
|
||||
fi
|
||||
# One readlink per link: uutils readlink (Ubuntu 26.04+) aborts at the first
|
||||
# unreadable operand, and other users' /proc/<pid>/exe are always unreadable.
|
||||
mount_busy() {
|
||||
for exe in /proc/[0-9]*/exe; do
|
||||
case "$(readlink "$exe" 2>/dev/null)" in
|
||||
"$mount_point"/*) return 0 ;;
|
||||
esac
|
||||
done
|
||||
return 1
|
||||
}
|
||||
APPDIR="$mount_point" "$app_run" "$@"
|
||||
rc=$?
|
||||
# Do not release the mount while any process still executes from it; releasing
|
||||
# early SIGBUSes Chromium children that are mid-shutdown.
|
||||
tries=0
|
||||
while [ "$tries" -lt 100 ]; do
|
||||
if readlink /proc/[0-9]*/exe 2>/dev/null | grep -qF "$mount_point/"; then
|
||||
if mount_busy; then
|
||||
sleep 0.1
|
||||
tries=$((tries + 1))
|
||||
else
|
||||
|
||||
@@ -425,25 +425,6 @@ test('subtitle annotation updates invalidate prefetched tokenizations before ref
|
||||
);
|
||||
});
|
||||
|
||||
test('subtitle processing controller resumes prefetch on settle, not on its emits', () => {
|
||||
const source = readMainSource();
|
||||
const depsBlock = source.match(
|
||||
/createBuildSubtitleProcessingControllerMainDepsHandler\(\{(?<body>[\s\S]*?)\n \}\);/,
|
||||
)?.groups?.body;
|
||||
|
||||
assert.ok(depsBlock);
|
||||
// A controller emit can be the provisional plain payload sent before the
|
||||
// scan runs, so it must not release the prefetch pause.
|
||||
assert.match(
|
||||
depsBlock,
|
||||
/emitSubtitle: \(payload\) => emitSubtitlePayload\(payload, \{ resumePrefetch: false \}\),/,
|
||||
);
|
||||
assert.match(
|
||||
depsBlock,
|
||||
/onProcessingSettled: \(\) => \{\s+subtitlePrefetchService\?\.resume\(\);/,
|
||||
);
|
||||
});
|
||||
|
||||
test('annotation upgrades skip the duplicate basic websocket event', () => {
|
||||
const source = readMainSource();
|
||||
const emitBlock = source.match(
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
import type {
|
||||
createEnsureAnilistMediaGuessHandler,
|
||||
createMaybeProbeAnilistDurationHandler,
|
||||
} from './anilist-media-guess';
|
||||
|
||||
type MaybeProbeAnilistDurationMainDeps = Parameters<
|
||||
typeof createMaybeProbeAnilistDurationHandler
|
||||
>[0];
|
||||
type EnsureAnilistMediaGuessMainDeps = Parameters<typeof createEnsureAnilistMediaGuessHandler>[0];
|
||||
|
||||
export function createBuildMaybeProbeAnilistDurationMainDepsHandler(
|
||||
deps: MaybeProbeAnilistDurationMainDeps,
|
||||
) {
|
||||
return (): MaybeProbeAnilistDurationMainDeps => ({
|
||||
getState: () => deps.getState(),
|
||||
setState: (state) => deps.setState(state),
|
||||
durationRetryIntervalMs: deps.durationRetryIntervalMs,
|
||||
now: () => deps.now(),
|
||||
requestMpvDuration: () => deps.requestMpvDuration(),
|
||||
logWarn: (message: string, error: unknown) => deps.logWarn(message, error),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildEnsureAnilistMediaGuessMainDepsHandler(
|
||||
deps: EnsureAnilistMediaGuessMainDeps,
|
||||
) {
|
||||
return (): EnsureAnilistMediaGuessMainDeps => ({
|
||||
getState: () => deps.getState(),
|
||||
setState: (state) => deps.setState(state),
|
||||
resolveMediaPathForJimaku: (currentMediaPath) =>
|
||||
deps.resolveMediaPathForJimaku(currentMediaPath),
|
||||
getCurrentMediaPath: () => deps.getCurrentMediaPath(),
|
||||
getCurrentMediaTitle: () => deps.getCurrentMediaTitle(),
|
||||
guessAnilistMediaInfo: (mediaPath, mediaTitle) =>
|
||||
deps.guessAnilistMediaInfo(mediaPath, mediaTitle),
|
||||
});
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
import type {
|
||||
createGetAnilistMediaGuessRuntimeStateHandler,
|
||||
createGetCurrentAnilistMediaKeyHandler,
|
||||
createRecordAnilistMediaDurationHandler,
|
||||
createResetAnilistMediaGuessStateHandler,
|
||||
createResetAnilistMediaTrackingHandler,
|
||||
createSetAnilistMediaGuessRuntimeStateHandler,
|
||||
} from './anilist-media-state';
|
||||
|
||||
type GetCurrentAnilistMediaKeyMainDeps = Parameters<
|
||||
typeof createGetCurrentAnilistMediaKeyHandler
|
||||
>[0];
|
||||
type ResetAnilistMediaTrackingMainDeps = Parameters<
|
||||
typeof createResetAnilistMediaTrackingHandler
|
||||
>[0];
|
||||
type GetAnilistMediaGuessRuntimeStateMainDeps = Parameters<
|
||||
typeof createGetAnilistMediaGuessRuntimeStateHandler
|
||||
>[0];
|
||||
type SetAnilistMediaGuessRuntimeStateMainDeps = Parameters<
|
||||
typeof createSetAnilistMediaGuessRuntimeStateHandler
|
||||
>[0];
|
||||
type RecordAnilistMediaDurationMainDeps = Parameters<
|
||||
typeof createRecordAnilistMediaDurationHandler
|
||||
>[0];
|
||||
type ResetAnilistMediaGuessStateMainDeps = Parameters<
|
||||
typeof createResetAnilistMediaGuessStateHandler
|
||||
>[0];
|
||||
|
||||
export function createBuildGetCurrentAnilistMediaKeyMainDepsHandler(
|
||||
deps: GetCurrentAnilistMediaKeyMainDeps,
|
||||
) {
|
||||
return (): GetCurrentAnilistMediaKeyMainDeps => ({
|
||||
getCurrentMediaPath: () => deps.getCurrentMediaPath(),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildResetAnilistMediaTrackingMainDepsHandler(
|
||||
deps: ResetAnilistMediaTrackingMainDeps,
|
||||
) {
|
||||
return (): ResetAnilistMediaTrackingMainDeps => ({
|
||||
setMediaKey: (value) => deps.setMediaKey(value),
|
||||
setMediaDurationSec: (value) => deps.setMediaDurationSec(value),
|
||||
setMediaGuess: (value) => deps.setMediaGuess(value),
|
||||
setMediaGuessPromise: (value) => deps.setMediaGuessPromise(value),
|
||||
setLastDurationProbeAtMs: (value: number) => deps.setLastDurationProbeAtMs(value),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildGetAnilistMediaGuessRuntimeStateMainDepsHandler(
|
||||
deps: GetAnilistMediaGuessRuntimeStateMainDeps,
|
||||
) {
|
||||
return (): GetAnilistMediaGuessRuntimeStateMainDeps => ({
|
||||
getMediaKey: () => deps.getMediaKey(),
|
||||
getMediaDurationSec: () => deps.getMediaDurationSec(),
|
||||
getMediaGuess: () => deps.getMediaGuess(),
|
||||
getMediaGuessPromise: () => deps.getMediaGuessPromise(),
|
||||
getLastDurationProbeAtMs: () => deps.getLastDurationProbeAtMs(),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildSetAnilistMediaGuessRuntimeStateMainDepsHandler(
|
||||
deps: SetAnilistMediaGuessRuntimeStateMainDeps,
|
||||
) {
|
||||
return (): SetAnilistMediaGuessRuntimeStateMainDeps => ({
|
||||
setMediaKey: (value) => deps.setMediaKey(value),
|
||||
setMediaDurationSec: (value) => deps.setMediaDurationSec(value),
|
||||
setMediaGuess: (value) => deps.setMediaGuess(value),
|
||||
setMediaGuessPromise: (value) => deps.setMediaGuessPromise(value),
|
||||
setLastDurationProbeAtMs: (value: number) => deps.setLastDurationProbeAtMs(value),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildRecordAnilistMediaDurationMainDepsHandler(
|
||||
deps: RecordAnilistMediaDurationMainDeps,
|
||||
) {
|
||||
return (): RecordAnilistMediaDurationMainDeps => ({
|
||||
getCurrentMediaKey: () => deps.getCurrentMediaKey(),
|
||||
getState: () => deps.getState(),
|
||||
setState: (state) => deps.setState(state),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildResetAnilistMediaGuessStateMainDepsHandler(
|
||||
deps: ResetAnilistMediaGuessStateMainDeps,
|
||||
) {
|
||||
return (): ResetAnilistMediaGuessStateMainDeps => ({
|
||||
setMediaGuess: (value) => deps.setMediaGuess(value),
|
||||
setMediaGuessPromise: (value) => deps.setMediaGuessPromise(value),
|
||||
});
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
import type {
|
||||
createMaybeRunAnilistPostWatchUpdateHandler,
|
||||
createProcessNextAnilistRetryUpdateHandler,
|
||||
} from './anilist-post-watch';
|
||||
|
||||
type ProcessNextAnilistRetryUpdateMainDeps = Parameters<
|
||||
typeof createProcessNextAnilistRetryUpdateHandler
|
||||
>[0];
|
||||
type MaybeRunAnilistPostWatchUpdateMainDeps = Parameters<
|
||||
typeof createMaybeRunAnilistPostWatchUpdateHandler
|
||||
>[0];
|
||||
|
||||
export function createBuildProcessNextAnilistRetryUpdateMainDepsHandler(
|
||||
deps: ProcessNextAnilistRetryUpdateMainDeps,
|
||||
) {
|
||||
return (): ProcessNextAnilistRetryUpdateMainDeps => ({
|
||||
nextReady: () => deps.nextReady(),
|
||||
refreshRetryQueueState: () => deps.refreshRetryQueueState(),
|
||||
setLastAttemptAt: (value: number) => deps.setLastAttemptAt(value),
|
||||
setLastError: (value: string | null) => deps.setLastError(value),
|
||||
refreshAnilistClientSecretState: () => deps.refreshAnilistClientSecretState(),
|
||||
updateAnilistPostWatchProgress: (
|
||||
accessToken: string,
|
||||
title: string,
|
||||
episode: number,
|
||||
season?: number | null,
|
||||
mediaId?: number | null,
|
||||
) => deps.updateAnilistPostWatchProgress(accessToken, title, episode, season, mediaId),
|
||||
markSuccess: (key: string) => deps.markSuccess(key),
|
||||
rememberAttemptedUpdateKey: (key: string) => deps.rememberAttemptedUpdateKey(key),
|
||||
markFailure: (key: string, message: string) => deps.markFailure(key, message),
|
||||
logInfo: (message: string) => deps.logInfo(message),
|
||||
now: () => deps.now(),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildMaybeRunAnilistPostWatchUpdateMainDepsHandler(
|
||||
deps: MaybeRunAnilistPostWatchUpdateMainDeps,
|
||||
) {
|
||||
return (): MaybeRunAnilistPostWatchUpdateMainDeps => ({
|
||||
getInFlight: () => deps.getInFlight(),
|
||||
setInFlight: (value: boolean) => deps.setInFlight(value),
|
||||
getResolvedConfig: () => deps.getResolvedConfig(),
|
||||
isAnilistTrackingEnabled: (config) => deps.isAnilistTrackingEnabled(config),
|
||||
getCurrentMediaKey: () => deps.getCurrentMediaKey(),
|
||||
hasMpvClient: () => deps.hasMpvClient(),
|
||||
getTrackedMediaKey: () => deps.getTrackedMediaKey(),
|
||||
resetTrackedMedia: (mediaKey) => deps.resetTrackedMedia(mediaKey),
|
||||
getWatchedSeconds: () => deps.getWatchedSeconds(),
|
||||
maybeProbeAnilistDuration: (mediaKey: string, options) =>
|
||||
deps.maybeProbeAnilistDuration(mediaKey, options),
|
||||
ensureAnilistMediaGuess: (mediaKey: string) => deps.ensureAnilistMediaGuess(mediaKey),
|
||||
hasAttemptedUpdateKey: (key: string) => deps.hasAttemptedUpdateKey(key),
|
||||
processNextAnilistRetryUpdate: () => deps.processNextAnilistRetryUpdate(),
|
||||
refreshAnilistClientSecretState: () => deps.refreshAnilistClientSecretState(),
|
||||
enqueueRetry: (
|
||||
key: string,
|
||||
title: string,
|
||||
episode: number,
|
||||
season?: number | null,
|
||||
mediaId?: number | null,
|
||||
) => deps.enqueueRetry(key, title, episode, season, mediaId),
|
||||
getCurrentMediaTitle: deps.getCurrentMediaTitle
|
||||
? () => deps.getCurrentMediaTitle!()
|
||||
: undefined,
|
||||
resolvePinnedAnilistMediaId: deps.resolvePinnedAnilistMediaId
|
||||
? (input) => deps.resolvePinnedAnilistMediaId!(input)
|
||||
: undefined,
|
||||
markRetryFailure: (key: string, message: string) => deps.markRetryFailure(key, message),
|
||||
markRetrySuccess: (key: string) => deps.markRetrySuccess(key),
|
||||
refreshRetryQueueState: () => deps.refreshRetryQueueState(),
|
||||
updateAnilistPostWatchProgress: (
|
||||
accessToken: string,
|
||||
title: string,
|
||||
episode: number,
|
||||
season?: number | null,
|
||||
mediaId?: number | null,
|
||||
) => deps.updateAnilistPostWatchProgress(accessToken, title, episode, season, mediaId),
|
||||
rememberAttemptedUpdateKey: (key: string) => deps.rememberAttemptedUpdateKey(key),
|
||||
showMpvOsd: (message: string) => deps.showMpvOsd(message),
|
||||
logInfo: (message: string) => deps.logInfo(message),
|
||||
logWarn: (message: string) => deps.logWarn(message),
|
||||
minWatchSeconds: deps.minWatchSeconds,
|
||||
minWatchRatio: deps.minWatchRatio,
|
||||
});
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
import type {
|
||||
createConsumeAnilistSetupTokenFromUrlHandler,
|
||||
createHandleAnilistSetupProtocolUrlHandler,
|
||||
createNotifyAnilistSetupHandler,
|
||||
createRegisterSubminerProtocolClientHandler,
|
||||
} from './anilist-setup-protocol';
|
||||
|
||||
type NotifyAnilistSetupMainDeps = Parameters<typeof createNotifyAnilistSetupHandler>[0];
|
||||
type ConsumeAnilistSetupTokenMainDeps = Parameters<
|
||||
typeof createConsumeAnilistSetupTokenFromUrlHandler
|
||||
>[0];
|
||||
type HandleAnilistSetupProtocolUrlMainDeps = Parameters<
|
||||
typeof createHandleAnilistSetupProtocolUrlHandler
|
||||
>[0];
|
||||
type RegisterSubminerProtocolClientMainDeps = Parameters<
|
||||
typeof createRegisterSubminerProtocolClientHandler
|
||||
>[0];
|
||||
|
||||
export function createBuildNotifyAnilistSetupMainDepsHandler(deps: NotifyAnilistSetupMainDeps) {
|
||||
return (): NotifyAnilistSetupMainDeps => ({
|
||||
getNotificationType: deps.getNotificationType ? () => deps.getNotificationType?.() : undefined,
|
||||
hasMpvClient: () => deps.hasMpvClient(),
|
||||
showMpvOsd: (message: string) => deps.showMpvOsd(message),
|
||||
showOverlayNotification: deps.showOverlayNotification
|
||||
? (payload) => deps.showOverlayNotification?.(payload)
|
||||
: undefined,
|
||||
showDesktopNotification: (title: string, options: { body: string }) =>
|
||||
deps.showDesktopNotification(title, options),
|
||||
logInfo: (message: string) => deps.logInfo(message),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildConsumeAnilistSetupTokenFromUrlMainDepsHandler(
|
||||
deps: ConsumeAnilistSetupTokenMainDeps,
|
||||
) {
|
||||
return (): ConsumeAnilistSetupTokenMainDeps => ({
|
||||
consumeAnilistSetupCallbackUrl: (input) => deps.consumeAnilistSetupCallbackUrl(input),
|
||||
saveToken: (token: string) => deps.saveToken(token),
|
||||
setCachedToken: (token: string) => deps.setCachedToken(token),
|
||||
setResolvedState: (resolvedAt: number) => deps.setResolvedState(resolvedAt),
|
||||
setSetupPageOpened: (opened: boolean) => deps.setSetupPageOpened(opened),
|
||||
onSuccess: () => deps.onSuccess(),
|
||||
closeWindow: () => deps.closeWindow(),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildHandleAnilistSetupProtocolUrlMainDepsHandler(
|
||||
deps: HandleAnilistSetupProtocolUrlMainDeps,
|
||||
) {
|
||||
return (): HandleAnilistSetupProtocolUrlMainDeps => ({
|
||||
consumeAnilistSetupTokenFromUrl: (rawUrl: string) =>
|
||||
deps.consumeAnilistSetupTokenFromUrl(rawUrl),
|
||||
logWarn: (message: string, details: unknown) => deps.logWarn(message, details),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildRegisterSubminerProtocolClientMainDepsHandler(
|
||||
deps: RegisterSubminerProtocolClientMainDeps,
|
||||
) {
|
||||
return (): RegisterSubminerProtocolClientMainDeps => ({
|
||||
isDefaultApp: () => deps.isDefaultApp(),
|
||||
getArgv: () => deps.getArgv(),
|
||||
execPath: deps.execPath,
|
||||
resolvePath: (value: string) => deps.resolvePath(value),
|
||||
setAsDefaultProtocolClient: (scheme: string, path?: string, args?: string[]) =>
|
||||
deps.setAsDefaultProtocolClient(scheme, path, args),
|
||||
logDebug: (message: string, details?: unknown) => deps.logDebug(message, details),
|
||||
});
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import type { createOpenAnilistSetupWindowHandler } from './anilist-setup-window';
|
||||
|
||||
type OpenAnilistSetupWindowMainDeps = Parameters<typeof createOpenAnilistSetupWindowHandler>[0];
|
||||
|
||||
export function createBuildOpenAnilistSetupWindowMainDepsHandler(
|
||||
deps: OpenAnilistSetupWindowMainDeps,
|
||||
) {
|
||||
return (): OpenAnilistSetupWindowMainDeps => ({
|
||||
maybeFocusExistingSetupWindow: () => deps.maybeFocusExistingSetupWindow(),
|
||||
createSetupWindow: () => deps.createSetupWindow(),
|
||||
buildAuthorizeUrl: () => deps.buildAuthorizeUrl(),
|
||||
consumeCallbackUrl: (rawUrl: string) => deps.consumeCallbackUrl(rawUrl),
|
||||
openSetupInBrowser: (authorizeUrl: string) => deps.openSetupInBrowser(authorizeUrl),
|
||||
loadManualTokenEntry: (setupWindow, authorizeUrl: string) =>
|
||||
deps.loadManualTokenEntry(setupWindow, authorizeUrl),
|
||||
redirectUri: deps.redirectUri,
|
||||
developerSettingsUrl: deps.developerSettingsUrl,
|
||||
isAllowedExternalUrl: (url: string) => deps.isAllowedExternalUrl(url),
|
||||
isAllowedNavigationUrl: (url: string) => deps.isAllowedNavigationUrl(url),
|
||||
logWarn: (message: string, details?: unknown) => deps.logWarn(message, details),
|
||||
logError: (message: string, details: unknown) => deps.logError(message, details),
|
||||
clearSetupWindow: () => deps.clearSetupWindow(),
|
||||
setSetupPageOpened: (opened: boolean) => deps.setSetupPageOpened(opened),
|
||||
setSetupWindow: (setupWindow) => deps.setSetupWindow(setupWindow),
|
||||
openExternal: (url: string) => deps.openExternal(url),
|
||||
});
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import type { createRefreshAnilistClientSecretStateHandler } from './anilist-token-refresh';
|
||||
|
||||
type RefreshAnilistClientSecretStateMainDeps = Parameters<
|
||||
typeof createRefreshAnilistClientSecretStateHandler
|
||||
>[0];
|
||||
|
||||
export function createBuildRefreshAnilistClientSecretStateMainDepsHandler(
|
||||
deps: RefreshAnilistClientSecretStateMainDeps,
|
||||
) {
|
||||
return (): RefreshAnilistClientSecretStateMainDeps => ({
|
||||
getResolvedConfig: () => deps.getResolvedConfig(),
|
||||
isAnilistTrackingEnabled: (config) => deps.isAnilistTrackingEnabled(config),
|
||||
getCachedAccessToken: () => deps.getCachedAccessToken(),
|
||||
setCachedAccessToken: (token) => deps.setCachedAccessToken(token),
|
||||
saveStoredToken: (token: string) => deps.saveStoredToken(token),
|
||||
loadStoredToken: () => deps.loadStoredToken(),
|
||||
setClientSecretState: (state) => deps.setClientSecretState(state),
|
||||
getAnilistSetupPageOpened: () => deps.getAnilistSetupPageOpened(),
|
||||
setAnilistSetupPageOpened: (opened: boolean) => deps.setAnilistSetupPageOpened(opened),
|
||||
openAnilistSetupWindow: () => deps.openAnilistSetupWindow(),
|
||||
now: () => deps.now(),
|
||||
});
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
import type { createRefreshKnownWordCacheHandler, PrimarySubtitle } from './anki-actions';
|
||||
|
||||
type RefreshKnownWordCacheMainDeps = Parameters<typeof createRefreshKnownWordCacheHandler>[0];
|
||||
|
||||
export function createBuildUpdateLastCardFromClipboardMainDepsHandler<TAnki>(deps: {
|
||||
getAnkiIntegration: () => TAnki;
|
||||
readClipboardText: () => string;
|
||||
showMpvOsd: (text: string) => void;
|
||||
updateLastCardFromClipboardCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
readClipboardText: () => string;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => Promise<void>;
|
||||
}) {
|
||||
return () => ({
|
||||
getAnkiIntegration: () => deps.getAnkiIntegration(),
|
||||
readClipboardText: () => deps.readClipboardText(),
|
||||
showMpvOsd: (text: string) => deps.showMpvOsd(text),
|
||||
updateLastCardFromClipboardCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
readClipboardText: () => string;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => deps.updateLastCardFromClipboardCore(options),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildRefreshKnownWordCacheMainDepsHandler(
|
||||
deps: RefreshKnownWordCacheMainDeps,
|
||||
) {
|
||||
return (): RefreshKnownWordCacheMainDeps => ({
|
||||
getAnkiIntegration: () => deps.getAnkiIntegration(),
|
||||
missingIntegrationMessage: deps.missingIntegrationMessage,
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildTriggerFieldGroupingMainDepsHandler<TAnki>(deps: {
|
||||
getAnkiIntegration: () => TAnki;
|
||||
showMpvOsd: (text: string) => void;
|
||||
triggerFieldGroupingCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => Promise<void>;
|
||||
}) {
|
||||
return () => ({
|
||||
getAnkiIntegration: () => deps.getAnkiIntegration(),
|
||||
showMpvOsd: (text: string) => deps.showMpvOsd(text),
|
||||
triggerFieldGroupingCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => deps.triggerFieldGroupingCore(options),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildMarkLastCardAsAudioCardMainDepsHandler<TAnki>(deps: {
|
||||
getAnkiIntegration: () => TAnki;
|
||||
showMpvOsd: (text: string) => void;
|
||||
markLastCardAsAudioCardCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => Promise<void>;
|
||||
}) {
|
||||
return () => ({
|
||||
getAnkiIntegration: () => deps.getAnkiIntegration(),
|
||||
showMpvOsd: (text: string) => deps.showMpvOsd(text),
|
||||
markLastCardAsAudioCardCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => deps.markLastCardAsAudioCardCore(options),
|
||||
});
|
||||
}
|
||||
|
||||
export function createBuildMineSentenceCardMainDepsHandler<TAnki, TMpv>(deps: {
|
||||
getAnkiIntegration: () => TAnki;
|
||||
getMpvClient: () => TMpv;
|
||||
getPrimarySubtitle?: () => PrimarySubtitle | null;
|
||||
showMpvOsd: (text: string) => void;
|
||||
mineSentenceCardCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
mpvClient: TMpv;
|
||||
primarySubtitle?: PrimarySubtitle;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => Promise<boolean>;
|
||||
}) {
|
||||
return () => ({
|
||||
getAnkiIntegration: () => deps.getAnkiIntegration(),
|
||||
getMpvClient: () => deps.getMpvClient(),
|
||||
...(deps.getPrimarySubtitle
|
||||
? { getPrimarySubtitle: () => deps.getPrimarySubtitle?.() ?? null }
|
||||
: {}),
|
||||
showMpvOsd: (text: string) => deps.showMpvOsd(text),
|
||||
mineSentenceCardCore: (options: {
|
||||
ankiIntegration: TAnki;
|
||||
mpvClient: TMpv;
|
||||
primarySubtitle?: PrimarySubtitle;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) => deps.mineSentenceCardCore(options),
|
||||
});
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import type { AppReadyRuntimeDepsFactoryInput } from '../app-lifecycle';
|
||||
|
||||
export function createBuildAppReadyRuntimeMainDepsHandler(deps: AppReadyRuntimeDepsFactoryInput) {
|
||||
return (): AppReadyRuntimeDepsFactoryInput => ({
|
||||
ensureDefaultConfigBootstrap: deps.ensureDefaultConfigBootstrap,
|
||||
loadSubtitlePosition: deps.loadSubtitlePosition,
|
||||
resolveKeybindings: deps.resolveKeybindings,
|
||||
createMpvClient: deps.createMpvClient,
|
||||
reloadConfig: deps.reloadConfig,
|
||||
getResolvedConfig: deps.getResolvedConfig,
|
||||
getConfigWarnings: deps.getConfigWarnings,
|
||||
logConfigWarning: deps.logConfigWarning,
|
||||
initRuntimeOptionsManager: deps.initRuntimeOptionsManager,
|
||||
setSecondarySubMode: deps.setSecondarySubMode,
|
||||
defaultSecondarySubMode: deps.defaultSecondarySubMode,
|
||||
defaultWebsocketPort: deps.defaultWebsocketPort,
|
||||
defaultAnnotationWebsocketPort: deps.defaultAnnotationWebsocketPort,
|
||||
defaultTexthookerPort: deps.defaultTexthookerPort,
|
||||
hasMpvWebsocketPlugin: deps.hasMpvWebsocketPlugin,
|
||||
startSubtitleWebsocket: deps.startSubtitleWebsocket,
|
||||
startAnnotationWebsocket: deps.startAnnotationWebsocket,
|
||||
startTexthooker: deps.startTexthooker,
|
||||
log: deps.log,
|
||||
setLogLevel: deps.setLogLevel,
|
||||
setLogRotation: deps.setLogRotation,
|
||||
setLogFileToggles: deps.setLogFileToggles,
|
||||
createMecabTokenizerAndCheck: deps.createMecabTokenizerAndCheck,
|
||||
createSubtitleTimingTracker: deps.createSubtitleTimingTracker,
|
||||
createImmersionTracker: deps.createImmersionTracker,
|
||||
startJellyfinRemoteSession: deps.startJellyfinRemoteSession,
|
||||
loadYomitanExtension: deps.loadYomitanExtension,
|
||||
ensureYomitanExtensionLoaded: deps.ensureYomitanExtensionLoaded,
|
||||
handleFirstRunSetup: deps.handleFirstRunSetup,
|
||||
prewarmSubtitleDictionaries: deps.prewarmSubtitleDictionaries,
|
||||
startBackgroundWarmups: deps.startBackgroundWarmups,
|
||||
texthookerOnlyMode: deps.texthookerOnlyMode,
|
||||
shouldAutoInitializeOverlayRuntimeFromConfig: deps.shouldAutoInitializeOverlayRuntimeFromConfig,
|
||||
setVisibleOverlayVisible: deps.setVisibleOverlayVisible,
|
||||
initializeOverlayRuntime: deps.initializeOverlayRuntime,
|
||||
runHeadlessInitialCommand: deps.runHeadlessInitialCommand,
|
||||
handleInitialArgs: deps.handleInitialArgs,
|
||||
onCriticalConfigErrors: deps.onCriticalConfigErrors,
|
||||
logDebug: deps.logDebug,
|
||||
now: deps.now,
|
||||
shouldRunHeadlessInitialCommand: deps.shouldRunHeadlessInitialCommand,
|
||||
shouldUseMinimalStartup: deps.shouldUseMinimalStartup,
|
||||
shouldSkipHeavyStartup: deps.shouldSkipHeavyStartup,
|
||||
shouldHandleInitialArgsBeforeDeferredOverlayWarmup:
|
||||
deps.shouldHandleInitialArgsBeforeDeferredOverlayWarmup,
|
||||
});
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { toSubtitleClock } from '../../core/services/subtitle-clock';
|
||||
import type { SubtitleCue, SubtitleData } from '../../types';
|
||||
import { selectAutoplayStartupCue } from './autoplay-subtitle-primer';
|
||||
import { primeVisibleOverlaySubtitleFromMpv } from './current-subtitle-snapshot';
|
||||
@@ -12,6 +13,7 @@ type AutoplaySubtitlePrimingMpvClient = {
|
||||
requestProperty: (name: string) => Promise<unknown>;
|
||||
currentVideoPath?: string;
|
||||
currentTimePos?: number;
|
||||
currentSubDelay?: number;
|
||||
currentSubText?: string;
|
||||
currentSecondarySubText?: string;
|
||||
setCurrentSecondarySubText?: (text: string) => void;
|
||||
@@ -156,7 +158,7 @@ export function createAutoplaySubtitlePrimingRuntime(deps: AutoplaySubtitlePrimi
|
||||
const currentTimeSec = Number(client?.currentTimePos ?? deps.getLastObservedTimePos());
|
||||
return resolvePrimarySubtitleText({
|
||||
liveText: text,
|
||||
currentTimeSec,
|
||||
currentTimeSec: toSubtitleClock(currentTimeSec, client?.currentSubDelay ?? 0),
|
||||
cues: deps.getActiveParsedSubtitleCues(),
|
||||
});
|
||||
}
|
||||
@@ -270,7 +272,10 @@ export function createAutoplaySubtitlePrimingRuntime(deps: AutoplaySubtitlePrimi
|
||||
const currentTimeSeconds = Number(
|
||||
timePosRaw ?? client?.currentTimePos ?? deps.getLastObservedTimePos() ?? 0,
|
||||
);
|
||||
const resolvedTimeSeconds = Number.isFinite(currentTimeSeconds) ? currentTimeSeconds : 0;
|
||||
const resolvedTimeSeconds = toSubtitleClock(
|
||||
Number.isFinite(currentTimeSeconds) ? currentTimeSeconds : 0,
|
||||
client?.currentSubDelay ?? 0,
|
||||
);
|
||||
const cue = selectAutoplayStartupCue(
|
||||
cues,
|
||||
resolvedTimeSeconds,
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import type { CliArgs } from '../../cli/args';
|
||||
|
||||
export function createBuildHandleTexthookerOnlyModeTransitionMainDepsHandler(deps: {
|
||||
isTexthookerOnlyMode: () => boolean;
|
||||
setTexthookerOnlyMode: (enabled: boolean) => void;
|
||||
commandNeedsOverlayStartupPrereqs: (args: CliArgs) => boolean;
|
||||
ensureOverlayStartupPrereqs: () => void;
|
||||
startBackgroundWarmups: () => void;
|
||||
logInfo: (message: string) => void;
|
||||
}) {
|
||||
return () => ({
|
||||
isTexthookerOnlyMode: () => deps.isTexthookerOnlyMode(),
|
||||
setTexthookerOnlyMode: (enabled: boolean) => deps.setTexthookerOnlyMode(enabled),
|
||||
commandNeedsOverlayStartupPrereqs: (args: CliArgs) =>
|
||||
deps.commandNeedsOverlayStartupPrereqs(args),
|
||||
ensureOverlayStartupPrereqs: () => deps.ensureOverlayStartupPrereqs(),
|
||||
startBackgroundWarmups: () => deps.startBackgroundWarmups(),
|
||||
logInfo: (message: string) => deps.logInfo(message),
|
||||
});
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
import type { CliArgs, CliCommandSource } from '../../cli/args';
|
||||
import { createHandleTexthookerOnlyModeTransitionHandler } from './cli-command-prechecks';
|
||||
import { createBuildHandleTexthookerOnlyModeTransitionMainDepsHandler } from './cli-command-prechecks-main-deps';
|
||||
|
||||
type HandleTexthookerOnlyModeTransitionMainDeps = Parameters<
|
||||
typeof createBuildHandleTexthookerOnlyModeTransitionMainDepsHandler
|
||||
typeof createHandleTexthookerOnlyModeTransitionHandler
|
||||
>[0];
|
||||
|
||||
export function createCliCommandRuntimeHandler<TCliContext>(deps: {
|
||||
@@ -17,9 +16,7 @@ export function createCliCommandRuntimeHandler<TCliContext>(deps: {
|
||||
) => void;
|
||||
}) {
|
||||
const handleTexthookerOnlyModeTransitionHandler = createHandleTexthookerOnlyModeTransitionHandler(
|
||||
createBuildHandleTexthookerOnlyModeTransitionMainDepsHandler(
|
||||
deps.handleTexthookerOnlyModeTransitionMainDeps,
|
||||
)(),
|
||||
deps.handleTexthookerOnlyModeTransitionMainDeps,
|
||||
);
|
||||
|
||||
return (args: CliArgs, source: CliCommandSource = 'initial'): void => {
|
||||
|
||||
Loaded 100 of 183 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user