mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-21 17:01:25 -07:00
fix(stats): stop counting duplicate typeset subtitle lines (#191)
This commit is contained in:
1 parent
046e74ea91
commit
b98d4d65c7
34 files changed
+2644
-35
No files matched your search
@@ -6,6 +6,8 @@ import type {
|
||||
StatsAnkiNotesInfoRequest,
|
||||
StatsCoverImagesRequest,
|
||||
StatsDeleteSessionsRequest,
|
||||
StatsDuplicateLineCleanupRequest,
|
||||
StatsDuplicateLineCleanupResult,
|
||||
StatsExcludedWordsRequest,
|
||||
StatsHttpClient,
|
||||
StatsJsonResponseMap,
|
||||
@@ -102,6 +104,19 @@ export const apiClient = {
|
||||
body: JSON.stringify({ words } satisfies StatsExcludedWordsRequest),
|
||||
});
|
||||
},
|
||||
cleanupDuplicateLines: async (
|
||||
options: StatsDuplicateLineCleanupRequest = {},
|
||||
): Promise<StatsDuplicateLineCleanupResult> => {
|
||||
const res = await fetchResponse('/api/stats/maintenance/duplicate-lines', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
dryRun: options.dryRun === true,
|
||||
lookbackDays: options.lookbackDays ?? null,
|
||||
} satisfies StatsDuplicateLineCleanupRequest),
|
||||
});
|
||||
return res.json() as Promise<StatsDuplicateLineCleanupResult>;
|
||||
},
|
||||
getWordOccurrences: (headword: string, word: string, reading: string, limit = 50, offset = 0) =>
|
||||
fetchJson(
|
||||
'wordOccurrences',
|
||||
|
||||
Reference in new issue
Block a user