mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-16 04:46:07 -08:00
fix(stats): count mined cards once and keep lexical stats exact after deletes
- Card creation now owns mined-card counting; remove the outer single and multi-line mining increments that double counted each card. - Preserve fractional first_seen/last_seen precision when session deletes compare and refresh lexical aggregates. - Derive vocabulary_visible from the stored word row on every write so the new-word charts agree with the filtered vocabulary summary. - Bump the lexical rollup version so existing databases re-derive visibility and repair stale last_seen values once in the background worker.
This commit is contained in:
18 files changed
+213
-114
No files matched your search
@@ -45,20 +45,17 @@ test('mining action main deps builders map callbacks', () => {
|
||||
getCurrentSecondarySubText: () => 'sub',
|
||||
showMpvOsd: (text) => calls.push(`mine-osd:${text}`),
|
||||
logError: (message) => calls.push(`err:${message}`),
|
||||
onCardsMined: (count) => calls.push(`cards:${count}`),
|
||||
handleMineSentenceDigitCore: () => calls.push('mine-digit'),
|
||||
})();
|
||||
assert.equal(mineDigit.getCurrentSecondarySubText(), 'sub');
|
||||
mineDigit.showMpvOsd('done');
|
||||
mineDigit.logError('bad', null);
|
||||
mineDigit.onCardsMined(2);
|
||||
mineDigit.handleMineSentenceDigitCore(2, {
|
||||
subtitleTimingTracker: { track: true },
|
||||
ankiIntegration: { enabled: true },
|
||||
getCurrentSecondarySubText: () => 'sub',
|
||||
showMpvOsd: () => {},
|
||||
logError: () => {},
|
||||
onCardsMined: () => {},
|
||||
});
|
||||
|
||||
assert.deepEqual(calls, [
|
||||
@@ -70,7 +67,6 @@ test('mining action main deps builders map callbacks', () => {
|
||||
'copy-current',
|
||||
'mine-osd:done',
|
||||
'err:bad',
|
||||
'cards:2',
|
||||
'mine-digit',
|
||||
]);
|
||||
});
|
||||
Reference in new issue
Block a user