feat: show mining frame toast on OSD and speed up stats session deletes

- Flash mined-frame screenshot as in-overlay image toast for OSD card notifications
- Batch cover art from stored DB blobs via POST /api/stats/covers (no extra AniList fetches)
- Show delete progress toast on stats home and sessions pages
- Refresh only affected rollups on session delete instead of full rebuild
- Rebuild lifetime summaries with aggregate SQL CTEs instead of per-session loop
This commit is contained in:
2026-06-04 22:00:51 -07:00
parent ea79e331fa
commit b343f1cf5c
45 changed files with 1199 additions and 209 deletions
@@ -0,0 +1,41 @@
import { useEffect, useState } from 'react';
import { getCoverImageSrc, type CoverImageMap } from '../../lib/cover-images';
interface CoverThumbnailProps {
animeId: number | null;
videoId: number | null;
title: string;
coverImages: CoverImageMap;
}
export function CoverThumbnail({ animeId, videoId, title, coverImages }: CoverThumbnailProps) {
const [failed, setFailed] = useState(false);
const fallbackChar = title.charAt(0) || '?';
const fallback = (
<div className="w-12 h-16 rounded bg-ctp-surface2 flex items-center justify-center text-ctp-overlay2 text-lg font-bold shrink-0">
{fallbackChar}
</div>
);
const src =
animeId != null
? getCoverImageSrc(coverImages, 'anime', animeId)
: getCoverImageSrc(coverImages, 'media', videoId);
useEffect(() => {
setFailed(false);
}, [src]);
if (!src || failed) {
return fallback;
}
return (
<img
src={src}
alt=""
className="w-12 h-16 rounded object-cover shrink-0 bg-ctp-surface2"
onError={() => setFailed(true)}
/>
);
}