feat(stats): add library entry merge and episode move (#190)

This commit is contained in:
sudacode authored and GitHub committed 2026-08-14 21:54:17 -07:00
1 parent c5a77ac067
commit 6fb3d2eb13
42 files changed
+4850 -89

No files matched your search

@@ -199,6 +199,18 @@ export async function enrichSessionsWithKnownWordMetrics<
);
}
/** Deduplicated positive integer ids from an untrusted JSON body field. */
export function parsePositiveIdList(raw: unknown): number[] {
if (!Array.isArray(raw)) return [];
const ids = new Set<number>();
for (const value of raw) {
if (Number.isSafeInteger(value) && (value as number) > 0) {
ids.add(value as number);
}
}
return [...ids];
}
export function parseBooleanQuery(raw: string | undefined, fallback: boolean): boolean {
if (raw === undefined) return fallback;
const normalized = raw.trim().toLowerCase();