diff --git a/config.example.jsonc b/config.example.jsonc index 067578b..52ae35f 100644 --- a/config.example.jsonc +++ b/config.example.jsonc @@ -319,6 +319,7 @@ "SubMiner" ], // Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging. "fields": { + "word": "Expression", // Word setting. "audio": "ExpressionAudio", // Audio setting. "image": "Picture", // Image setting. "sentence": "Sentence", // Sentence setting. @@ -347,7 +348,7 @@ "highlightEnabled": false, // Enable fast local highlighting for words already known in Anki. Values: true | false "refreshMinutes": 1440, // Minutes between known-word cache refreshes. "matchMode": "headword", // Known-word matching strategy for subtitle annotations. Values: headword | surface - "decks": [], // Decks used for known-word cache scope. Supports one or more deck names. + "decks": {}, // Decks and fields for known-word cache. Object mapping deck names to arrays of field names to extract, e.g. { "Kaishi 1.5k": ["Word", "Word Reading"] }. "color": "#a6da95" // Color used for known-word highlights. }, // Known words setting. "behavior": { @@ -498,13 +499,21 @@ "queueCap": 1000, // In-memory write queue cap before overflow policy applies. "payloadCapBytes": 256, // Max JSON payload size per event before truncation. "maintenanceIntervalMs": 86400000, // Maintenance cadence (prune + rollup + vacuum checks). + "retentionMode": "preset", // Retention mode (`preset` uses preset values, `advanced` uses explicit values). Values: preset | advanced + "retentionPreset": "balanced", // Retention preset when `retentionMode` is `preset`. Values: minimal | balanced | deep-history "retention": { - "eventsDays": 7, // Raw event retention window in days. - "telemetryDays": 30, // Telemetry retention window in days. - "dailyRollupsDays": 365, // Daily rollup retention window in days. - "monthlyRollupsDays": 1825, // Monthly rollup retention window in days. - "vacuumIntervalDays": 7 // Minimum days between VACUUM runs. - } // Retention setting. + "eventsDays": 0, // Raw event retention window in days. Use 0 to keep all. + "telemetryDays": 0, // Telemetry retention window in days. Use 0 to keep all. + "sessionsDays": 0, // Session retention window in days. Use 0 to keep all. + "dailyRollupsDays": 0, // Daily rollup retention window in days. Use 0 to keep all. + "monthlyRollupsDays": 0, // Monthly rollup retention window in days. Use 0 to keep all. + "vacuumIntervalDays": 0 // Minimum days between VACUUM runs. Use 0 to disable. + }, // Retention setting. + "lifetimeSummaries": { + "global": true, // Maintain global lifetime stats rows. Values: true | false + "anime": true, // Maintain per-anime lifetime stats rows. Values: true | false + "media": true // Maintain per-media lifetime stats rows. Values: true | false + } // Lifetime summaries setting. }, // Enable/disable immersion tracking. // ========================================== @@ -514,6 +523,7 @@ // ========================================== "stats": { "toggleKey": "Backquote", // Key code to toggle the stats overlay. + "markWatchedKey": "KeyW", // Key code to mark the current video as watched and advance to the next playlist entry. "serverPort": 6969, // Port for the stats HTTP server. "autoStartServer": true, // Automatically start the stats server on launch. Values: true | false "autoOpenBrowser": true // Automatically open the stats dashboard in a browser when the server starts. Values: true | false diff --git a/docs-site/anki-integration.md b/docs-site/anki-integration.md index a17f8ff..ca4f4a2 100644 --- a/docs-site/anki-integration.md +++ b/docs-site/anki-integration.md @@ -114,6 +114,7 @@ SubMiner maps its data to your Anki note fields. Configure these under `ankiConn ```jsonc "ankiConnect": { "fields": { + "word": "Expression", // mined word / expression text "audio": "ExpressionAudio", // audio clip from the video "image": "Picture", // screenshot or animated clip "sentence": "Sentence", // subtitle text diff --git a/docs-site/configuration.md b/docs-site/configuration.md index 4b97ce2..5bde096 100644 --- a/docs-site/configuration.md +++ b/docs-site/configuration.md @@ -733,6 +733,7 @@ Enable automatic Anki card creation and updates with media generation: "tags": ["SubMiner"], "deck": "Learning::Japanese", "fields": { + "word": "Expression", "audio": "ExpressionAudio", "image": "Picture", "sentence": "Sentence", @@ -797,6 +798,7 @@ This example is intentionally compact. The option table below documents availabl | `tags` | array of strings | Tags automatically added to cards mined/updated by SubMiner (default: `['SubMiner']`; set `[]` to disable automatic tagging). | | `deck` | string | Anki deck to monitor for new cards | | `ankiConnect.knownWords.decks` | array of strings | Decks used for known-word cache lookups. When omitted/empty, falls back to `ankiConnect.deck`. | +| `fields.word` | string | Card field for mined word / expression text (default: `Expression`) | | `fields.audio` | string | Card field for audio files (default: `ExpressionAudio`) | | `fields.image` | string | Card field for images (default: `Picture`) | | `fields.sentence` | string | Card field for sentences (default: `Sentence`) | diff --git a/docs-site/immersion-tracking.md b/docs-site/immersion-tracking.md index cabca0c..f7519ec 100644 --- a/docs-site/immersion-tracking.md +++ b/docs-site/immersion-tracking.md @@ -30,13 +30,37 @@ The same immersion data powers the stats dashboard. - Maintenance command: run `subminer stats cleanup` or `subminer stats cleanup -v` to backfill/repair vocabulary metadata (`headword`, `reading`, POS) and purge stale or excluded rows from `imm_words` on demand. - Browser page: open `http://127.0.0.1:5175` directly if the local stats server is already running. -Dashboard tabs: +### Dashboard Tabs -- Overview: recent sessions, streak calendar, watch-time history, and a tracking snapshot with completed episodes/anime totals -- Library: cover-art library, per-series progress, episode drill-down, and direct links into mined cards -- Trends: watch time, sessions, words seen, and per-anime progress/pattern charts -- Sessions: expandable session history with new-word activity, cumulative totals, and pause/seek/card markers -- Vocabulary: top repeated words (click a bar to open the word), new-word timeline, frequency rank table with full readings, kanji breakdown, word exclusion list, and click-through occurrence drilldown with Mine Word / Mine Sentence / Mine Audio buttons +#### Overview + +Recent sessions, streak calendar, watch-time history, and a tracking snapshot with completed episodes/anime totals. + +![Stats Overview](/screenshots/stats-overview.png) + +#### Library + +Cover-art library with search and sorting, per-series progress, episode drill-down, and direct links into mined cards. + +![Stats Library](/screenshots/stats-library.png) + +#### Trends + +Watch time, sessions, words seen, and per-anime progress/pattern charts with configurable date ranges and grouping. + +![Stats Trends](/screenshots/stats-trends.png) + +#### Sessions + +Expandable session history with new-word activity, cumulative totals, and pause/seek/card markers. + +![Stats Sessions](/screenshots/stats-sessions.png) + +#### Vocabulary + +Top repeated words (click a bar to open the word), new-word timeline, frequency rank table with full readings, kanji breakdown, word exclusion list, and click-through occurrence drilldown with Mine Word / Mine Sentence / Mine Audio buttons. + +![Stats Vocabulary](/screenshots/stats-vocabulary.png) Stats server config lives under `stats`: @@ -244,7 +268,7 @@ LIMIT ?; - Large-table reads are index-backed for `sample_ms`, session time windows, frequency-ranked words/kanji, and cover-art identity lookups. - Workload-dependent tuning knobs remain at defaults unless you change them: `cache_size`, `mmap_size`, `temp_store`, `auto_vacuum`. -### Schema (v12) +### Schema (v4) Core tables: diff --git a/docs-site/public/config.example.jsonc b/docs-site/public/config.example.jsonc index e65c2ad..52ae35f 100644 --- a/docs-site/public/config.example.jsonc +++ b/docs-site/public/config.example.jsonc @@ -319,6 +319,7 @@ "SubMiner" ], // Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging. "fields": { + "word": "Expression", // Word setting. "audio": "ExpressionAudio", // Audio setting. "image": "Picture", // Image setting. "sentence": "Sentence", // Sentence setting. @@ -347,7 +348,7 @@ "highlightEnabled": false, // Enable fast local highlighting for words already known in Anki. Values: true | false "refreshMinutes": 1440, // Minutes between known-word cache refreshes. "matchMode": "headword", // Known-word matching strategy for subtitle annotations. Values: headword | surface - "decks": [], // Decks used for known-word cache scope. Supports one or more deck names. + "decks": {}, // Decks and fields for known-word cache. Object mapping deck names to arrays of field names to extract, e.g. { "Kaishi 1.5k": ["Word", "Word Reading"] }. "color": "#a6da95" // Color used for known-word highlights. }, // Known words setting. "behavior": { @@ -498,8 +499,8 @@ "queueCap": 1000, // In-memory write queue cap before overflow policy applies. "payloadCapBytes": 256, // Max JSON payload size per event before truncation. "maintenanceIntervalMs": 86400000, // Maintenance cadence (prune + rollup + vacuum checks). - "retentionMode": "preset", // Retention mode to use for defaults. Values: preset | advanced - "retentionPreset": "balanced", // Named preset when retentionMode is preset. + "retentionMode": "preset", // Retention mode (`preset` uses preset values, `advanced` uses explicit values). Values: preset | advanced + "retentionPreset": "balanced", // Retention preset when `retentionMode` is `preset`. Values: minimal | balanced | deep-history "retention": { "eventsDays": 0, // Raw event retention window in days. Use 0 to keep all. "telemetryDays": 0, // Telemetry retention window in days. Use 0 to keep all. @@ -509,10 +510,10 @@ "vacuumIntervalDays": 0 // Minimum days between VACUUM runs. Use 0 to disable. }, // Retention setting. "lifetimeSummaries": { - "global": true, // Keep lifetime global totals. - "anime": true, // Keep lifetime per-anime totals. - "media": true // Keep lifetime per-media totals. - } // Lifetime summary setting. + "global": true, // Maintain global lifetime stats rows. Values: true | false + "anime": true, // Maintain per-anime lifetime stats rows. Values: true | false + "media": true // Maintain per-media lifetime stats rows. Values: true | false + } // Lifetime summaries setting. }, // Enable/disable immersion tracking. // ========================================== @@ -522,6 +523,7 @@ // ========================================== "stats": { "toggleKey": "Backquote", // Key code to toggle the stats overlay. + "markWatchedKey": "KeyW", // Key code to mark the current video as watched and advance to the next playlist entry. "serverPort": 6969, // Port for the stats HTTP server. "autoStartServer": true, // Automatically start the stats server on launch. Values: true | false "autoOpenBrowser": true // Automatically open the stats dashboard in a browser when the server starts. Values: true | false diff --git a/docs-site/public/screenshots/anki-mining.png b/docs-site/public/screenshots/anki-mining.png new file mode 100644 index 0000000..f535597 Binary files /dev/null and b/docs-site/public/screenshots/anki-mining.png differ diff --git a/docs-site/public/screenshots/annotations-key.png b/docs-site/public/screenshots/annotations-key.png new file mode 100644 index 0000000..da6bffd Binary files /dev/null and b/docs-site/public/screenshots/annotations-key.png differ diff --git a/docs-site/public/screenshots/annotations.png b/docs-site/public/screenshots/annotations.png new file mode 100644 index 0000000..37918a5 Binary files /dev/null and b/docs-site/public/screenshots/annotations.png differ diff --git a/docs-site/public/screenshots/stats-library.png b/docs-site/public/screenshots/stats-library.png new file mode 100644 index 0000000..cd2dee2 Binary files /dev/null and b/docs-site/public/screenshots/stats-library.png differ diff --git a/docs-site/public/screenshots/stats-overview.png b/docs-site/public/screenshots/stats-overview.png new file mode 100644 index 0000000..fb4a2da Binary files /dev/null and b/docs-site/public/screenshots/stats-overview.png differ diff --git a/docs-site/public/screenshots/stats-sessions.png b/docs-site/public/screenshots/stats-sessions.png new file mode 100644 index 0000000..0c4d396 Binary files /dev/null and b/docs-site/public/screenshots/stats-sessions.png differ diff --git a/docs-site/public/screenshots/stats-trends.png b/docs-site/public/screenshots/stats-trends.png new file mode 100644 index 0000000..5455292 Binary files /dev/null and b/docs-site/public/screenshots/stats-trends.png differ diff --git a/docs-site/public/screenshots/stats-vocabulary.png b/docs-site/public/screenshots/stats-vocabulary.png new file mode 100644 index 0000000..fee14a9 Binary files /dev/null and b/docs-site/public/screenshots/stats-vocabulary.png differ diff --git a/docs-site/public/screenshots/texthooker-empty.png b/docs-site/public/screenshots/texthooker-empty.png new file mode 100644 index 0000000..6293eb8 Binary files /dev/null and b/docs-site/public/screenshots/texthooker-empty.png differ diff --git a/docs-site/public/screenshots/texthooker.png b/docs-site/public/screenshots/texthooker.png new file mode 100644 index 0000000..86da8cc Binary files /dev/null and b/docs-site/public/screenshots/texthooker.png differ diff --git a/docs-site/public/screenshots/yomitan-lookup.png b/docs-site/public/screenshots/yomitan-lookup.png new file mode 100644 index 0000000..de309bf Binary files /dev/null and b/docs-site/public/screenshots/yomitan-lookup.png differ