feat(stats): separate YouTube channels in the Library

- Store YouTube channels as a distinct media kind and migrate legacy entries safely
- Add All Titles, Anime, and YouTube filters with channel-specific stats views
This commit is contained in:
2026-09-18 23:53:26 -07:00
parent 026d495fac
commit d71aab37dc
30 changed files with 475 additions and 47 deletions
@@ -6,6 +6,7 @@ import { confirmAnimeDelete, setDeleteConfirmPresenter } from '../../lib/delete-
import type { AnimeDetailData } from '../../types/stats';
const DETAIL: AnimeDetailData['detail'] = {
mediaKind: 'anime',
animeId: 3,
canonicalTitle: 'Project Radio Noise Season 2',
anilistId: 20661,
@@ -69,3 +70,16 @@ test('confirmAnimeDelete spells out how much data the entry deletion removes', a
assert.match(seen[1] ?? '', /3 episodes/);
assert.match(seen[0] ?? '', /every session and stat/);
});
test('YouTube channel headers show videos and omit all AniList controls', () => {
const markup = renderToStaticMarkup(
<AnimeHeader
detail={{ ...DETAIL, mediaKind: 'youtube' }}
anilistEntries={[{ anilistId: 20661, titleRomaji: null, titleEnglish: null, season: null }]}
onChangeAnilist={() => {}}
/>,
);
assert.match(markup, /YouTube channel/);
assert.match(markup, /video/);
assert.doesNotMatch(markup, /AniList|anilist\.co|episode/);
});