From 142233828857124091f108f74646fc08ddbb3773 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 17 Dec 2025 03:20:49 -0800 Subject: fix(EpisodeDiscussionCollector): Improve filtering --- src/lib/Data/AniList/forum.ts | 5 ++++- src/lib/Tools/EpisodeDiscussionCollector.svelte | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Data/AniList/forum.ts b/src/lib/Data/AniList/forum.ts index a96b74ca..b2467c9e 100644 --- a/src/lib/Data/AniList/forum.ts +++ b/src/lib/Data/AniList/forum.ts @@ -11,6 +11,9 @@ export interface Thread { medium: string; }; }[]; + categories: { + name: string; + }[]; } export interface ThreadPage { @@ -35,7 +38,7 @@ const threadPage = async (page: number, userId: number): Promise => }, body: JSON.stringify({ query: `{ Page(perPage: 50, page: ${page}) { - threads(userId: ${userId}) { id title createdAt mediaCategories { coverImage { extraLarge medium } } } + threads(userId: ${userId}) { id title createdAt mediaCategories { coverImage { extraLarge medium } } categories { name } } pageInfo { hasNextPage } } }` }) diff --git a/src/lib/Tools/EpisodeDiscussionCollector.svelte b/src/lib/Tools/EpisodeDiscussionCollector.svelte index 4c61f3cf..b14c655b 100644 --- a/src/lib/Tools/EpisodeDiscussionCollector.svelte +++ b/src/lib/Tools/EpisodeDiscussionCollector.svelte @@ -21,9 +21,9 @@ {#await threads(submission)} {:then threads} -
    +
      {#each threads - .filter((thread) => thread.title.includes('[Spoilers]') && thread.title.includes('Episode')) + .filter( (thread) => thread.categories.some( (category) => category.name.includes('Release Discussion') ) ) .sort((a, b) => b.createdAt - a.createdAt) as thread}
    1. @@ -43,7 +43,7 @@
    2. {/each} -
+ {:catch}

Threads could not be loaded. You might have been rate-limited.

-- cgit v1.2.3