mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-20 00:15:27 -07:00
fix(stats): stop counting duplicate typeset subtitle lines (#191)
This commit is contained in:
@@ -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