feat(stats): speed up session maintenance and improve stats UI (#111)

This commit is contained in:
2026-06-08 02:20:52 -07:00
committed by GitHub
parent e6a16a069b
commit 311f1e8ee5
108 changed files with 7440 additions and 728 deletions
@@ -0,0 +1,26 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { renderToStaticMarkup } from 'react-dom/server';
import { AnimeCard } from './AnimeCard';
test('AnimeCard includes linked AniList id in cover URLs to avoid stale library covers', () => {
const markup = renderToStaticMarkup(
<AnimeCard
anime={{
animeId: 42,
canonicalTitle: 'Test Anime',
anilistId: 21699,
totalSessions: 1,
totalActiveMs: 600_000,
totalCards: 0,
totalTokensSeen: 100,
episodeCount: 1,
episodesTotal: 10,
lastWatchedMs: 1_000,
}}
onClick={() => {}}
/>,
);
assert.match(markup, /\/api\/stats\/anime\/42\/cover\?coverRetry=21699/);
});