mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-30 19:21:32 -07:00
feat(stats): add Hide Kana filter and fix vocabulary exclusion matching
- Remove overlay mining image toast; OSD card notifications no longer flash a frame screenshot - Add Hide Kana toggle to frequency rank table to filter kana-only headwords - Fix vocab exclusions to deduplicate and match token variants (e.g. ない / 無い) under one exclusion entry - Skip cover image fetching when the overview tab is inactive
This commit is contained in:
@@ -406,47 +406,6 @@ test('AnkiIntegration marks partial update notifications as failures in OSD mode
|
||||
assert.deepEqual(osdMessages, ['x Updated card: taberu (image failed)']);
|
||||
});
|
||||
|
||||
test('AnkiIntegration emits a mining image data URL to the overlay for OSD notifications', async () => {
|
||||
const osdMessages: string[] = [];
|
||||
const overlayImages: string[] = [];
|
||||
const integration = new AnkiIntegration(
|
||||
{
|
||||
behavior: {
|
||||
notificationType: 'osd',
|
||||
},
|
||||
},
|
||||
{} as never,
|
||||
{ currentVideoPath: '/tmp/video.mkv', currentTimePos: 12 } as never,
|
||||
(text) => {
|
||||
osdMessages.push(text);
|
||||
},
|
||||
);
|
||||
integration.setMiningImageOverlayCallback((image) => {
|
||||
overlayImages.push(image);
|
||||
});
|
||||
|
||||
const internals = integration as unknown as {
|
||||
mediaGenerator: {
|
||||
generateNotificationIcon: (path: string, timestamp: number) => Promise<Buffer>;
|
||||
};
|
||||
showNotification: (
|
||||
noteId: number,
|
||||
label: string | number,
|
||||
errorSuffix?: string,
|
||||
) => Promise<void>;
|
||||
};
|
||||
internals.mediaGenerator = {
|
||||
generateNotificationIcon: async () => Buffer.from('frame-bytes'),
|
||||
} as never;
|
||||
|
||||
await internals.showNotification(7, 'taberu');
|
||||
|
||||
assert.deepEqual(osdMessages, ['✓ Updated card: taberu']);
|
||||
assert.deepEqual(overlayImages, [
|
||||
`data:image/png;base64,${Buffer.from('frame-bytes').toString('base64')}`,
|
||||
]);
|
||||
});
|
||||
|
||||
test('FieldGroupingMergeCollaborator keeps SentenceAudio grouped without overwriting ExpressionAudio', async () => {
|
||||
const collaborator = createFieldGroupingMergeCollaborator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user