mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 04:19:25 -07:00
fix(ci): restore stats-server fallback and unblock coverage tests
This commit is contained in:
@@ -41,28 +41,6 @@ The update flow:
|
||||
3. **Progress check** -- SubMiner fetches your current list entry for the matched media. If your recorded progress already meets or exceeds the detected episode, the update is skipped.
|
||||
4. **Mutation** -- A `SaveMediaListEntry` mutation sets the new progress and marks the entry as `CURRENT`.
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
classDef step fill:#c6a0f6,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef action fill:#8aadf4,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef result fill:#a6da95,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef enrich fill:#8bd5ca,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef ext fill:#eed49f,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
|
||||
Play["Media Plays"]:::step
|
||||
Detect["Episode Detected"]:::action
|
||||
Queue["Update Queue"]:::action
|
||||
Rate["Rate Limiter"]:::enrich
|
||||
GQL["GraphQL Mutation"]:::ext
|
||||
Done["Progress Updated"]:::result
|
||||
|
||||
Play --> Detect
|
||||
Detect --> Queue
|
||||
Queue --> Rate
|
||||
Rate --> GQL
|
||||
GQL --> Done
|
||||
```
|
||||
|
||||
## Update Queue and Retry
|
||||
|
||||
Failed AniList updates are persisted to a retry queue on disk and retried with exponential backoff.
|
||||
|
||||
@@ -31,30 +31,6 @@ The feature has three stages: **snapshot**, **merge**, and **match**.
|
||||
|
||||
3. **Match** — During subtitle rendering, Yomitan scans subtitle text against all loaded dictionaries including the character dictionary. Tokens that match a character entry are flagged with `isNameMatch` and highlighted in the overlay with a distinct color.
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
classDef api fill:#a6da95,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef store fill:#8aadf4,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef build fill:#b7bdf8,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef dict fill:#c6a0f6,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef render fill:#8bd5ca,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
|
||||
AL["AniList API"]:::api
|
||||
Snap["Snapshot JSON"]:::store
|
||||
Merge["Merge"]:::build
|
||||
ZIP["Yomitan ZIP"]:::dict
|
||||
Yomi["Yomitan Import"]:::dict
|
||||
Sub["Subtitle Scan"]:::render
|
||||
HL["Name Highlight"]:::render
|
||||
|
||||
AL -->|"GraphQL"| Snap
|
||||
Snap --> Merge
|
||||
Merge --> ZIP
|
||||
ZIP --> Yomi
|
||||
Yomi --> Sub
|
||||
Sub --> HL
|
||||
```
|
||||
|
||||
## Enabling the Feature
|
||||
|
||||
Character dictionary sync is disabled by default. To turn it on:
|
||||
|
||||
@@ -4,7 +4,16 @@ For internal architecture/workflow guidance, use `docs/README.md` at the repo ro
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Bun](https://bun.sh)
|
||||
- Required for all contributor workflows:
|
||||
- [Bun](https://bun.sh)
|
||||
- `git` with submodule support
|
||||
- Required by commands used on this page:
|
||||
- `bash` for helper scripts such as `make dev-watch`, `bun run format:check:src`, and `bash scripts/verify-generated-launcher.sh`
|
||||
- `unzip` on macOS/Linux for the bundled Yomitan build step inside `bun run build`
|
||||
- `lua` for plugin/environment test lanes such as `bun run test:env` and `bun run test:launcher`
|
||||
- Platform-specific / conditional:
|
||||
- `swiftc` on macOS is optional. If absent, the build falls back to staging the Swift helper source instead of compiling the helper binary.
|
||||
- Windows uses `powershell.exe` during the bundled Yomitan extraction step. A normal Windows install already provides it.
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -21,6 +30,8 @@ bun install
|
||||
|
||||
`make deps` is still available as a convenience wrapper around the same dependency install flow.
|
||||
|
||||
If you only need the default TypeScript/unit lanes, Bun plus the checked-in dependencies is enough after install. The extra tools above are only needed when you run the commands that invoke them.
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
@@ -40,6 +51,8 @@ make build-launcher
|
||||
|
||||
`bun run build` includes the Yomitan build step. It builds the bundled Chrome extension directly from the `vendor/subminer-yomitan` submodule into `build/yomitan` using Bun.
|
||||
|
||||
On macOS/Linux, that build also shells out to `unzip` while extracting the Yomitan artifact. On macOS, the asset staging step will compile the helper with `swiftc` when available, then fall back to copying the `.swift` source if not.
|
||||
|
||||
## Launcher Artifact Workflow
|
||||
|
||||
- Source of truth: `launcher/*.ts`
|
||||
@@ -94,6 +107,11 @@ bun run test:subtitle # maintained alass/ffsubsync subtitle surface
|
||||
- `bun run test:env` covers environment-sensitive checks: launcher smoke/plugin verification plus the Bun source SQLite lane.
|
||||
- `bun run test:immersion:sqlite` is the reproducible persistence lane when you need real DB-backed SQLite coverage under Bun.
|
||||
|
||||
Command-specific test deps:
|
||||
|
||||
- `bun run test:env` and `bun run test:launcher` invoke Lua-based plugin checks, so `lua` must be installed.
|
||||
- `bun run format:src` and `bun run format:check:src` invoke `bash scripts/prettier-scope.sh`.
|
||||
|
||||
The Bun-managed discovery lanes intentionally exclude a small compiled/runtime-focused set: `src/core/services/ipc.test.ts`, `src/core/services/anki-jimaku-ipc.test.ts`, `src/core/services/overlay-manager.test.ts`, `src/main/config-validation.test.ts`, `src/main/runtime/startup-config.test.ts`, and `src/main/runtime/registry.test.ts`. `bun run test:runtime:compat` keeps them in the standard workflow via `dist/**`.
|
||||
|
||||
Suggested local gate before handoff:
|
||||
|
||||
@@ -26,31 +26,6 @@ If no files match the current episode filter, a "Show all files" button lets you
|
||||
| `Arrow Up` / `Arrow Down` | Navigate entries or files |
|
||||
| `Escape` | Close modal |
|
||||
|
||||
### Flow
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
classDef step fill:#c6a0f6,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef action fill:#8aadf4,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef result fill:#a6da95,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
classDef enrich fill:#8bd5ca,stroke:#494d64,color:#24273a,stroke-width:1.5px
|
||||
|
||||
Open["Open Jimaku modal (Ctrl+Shift+J)"]:::step
|
||||
Parse["Auto-fill title, season, episode from filename"]:::enrich
|
||||
Search["Search Jimaku API"]:::action
|
||||
Entries["Browse matching entries"]:::action
|
||||
Files["Browse subtitle files"]:::action
|
||||
Download["Download selected file"]:::action
|
||||
Load["Load subtitle into mpv"]:::result
|
||||
|
||||
Open --> Parse
|
||||
Parse --> Search
|
||||
Search --> Entries
|
||||
Entries --> Files
|
||||
Files --> Download
|
||||
Download --> Load
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Add a `jimaku` section to your `config.jsonc`:
|
||||
|
||||
@@ -17,41 +17,6 @@ When SubMiner detects a YouTube URL (or `ytsearch:` target), it pauses mpv at st
|
||||
4. **Download** --- Selected tracks are fetched via direct URL when available, falling back to `yt-dlp --write-subs` / `--write-auto-subs`. YouTube TimedText XML formats (`srv1`/`srv2`/`srv3`) are converted to VTT on the fly. Auto-generated VTT captions are normalized to remove rolling-caption duplication.
|
||||
5. **Load** --- Subtitle files are injected into mpv via `sub-add`. Playback resumes once the primary track is ready; secondary failures do not block.
|
||||
|
||||
## Pipeline Diagram
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
classDef step fill:#c6a0f6,stroke:#494d64,color:#24273a
|
||||
classDef action fill:#8aadf4,stroke:#494d64,color:#24273a
|
||||
classDef result fill:#a6da95,stroke:#494d64,color:#24273a
|
||||
classDef enrich fill:#8bd5ca,stroke:#494d64,color:#24273a
|
||||
classDef ext fill:#eed49f,stroke:#494d64,color:#24273a
|
||||
|
||||
A[YouTube URL detected]:::step
|
||||
B[yt-dlp probe]:::ext
|
||||
C[Track discovery]:::action
|
||||
D{Auto or manual selection?}:::step
|
||||
E[Auto-select best tracks]:::action
|
||||
F[Manual picker — Ctrl+Alt+C]:::action
|
||||
G[Download subtitle files]:::action
|
||||
H[Convert TimedText to VTT]:::enrich
|
||||
I[Normalize auto-caption duplicates]:::enrich
|
||||
K[sub-add into mpv]:::action
|
||||
L[Overlay renders subtitles]:::result
|
||||
|
||||
A --> B
|
||||
B --> C
|
||||
C --> D
|
||||
D -- startup --> E
|
||||
D -- user request --> F
|
||||
E --> G
|
||||
F --> G
|
||||
G --> H
|
||||
H --> I
|
||||
I --> K
|
||||
K --> L
|
||||
```
|
||||
|
||||
## Auto-Load Flow
|
||||
|
||||
On startup with a YouTube URL:
|
||||
|
||||
Reference in New Issue
Block a user