diff options
Diffstat (limited to 'src/lib/Tools/EpisodeDiscussionCollector.svelte')
| -rw-r--r-- | src/lib/Tools/EpisodeDiscussionCollector.svelte | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/lib/Tools/EpisodeDiscussionCollector.svelte b/src/lib/Tools/EpisodeDiscussionCollector.svelte index d213949f..4c61f3cf 100644 --- a/src/lib/Tools/EpisodeDiscussionCollector.svelte +++ b/src/lib/Tools/EpisodeDiscussionCollector.svelte @@ -1,61 +1,61 @@ <script lang="ts"> - import { threads } from '$lib/Data/AniList/forum'; - import { onMount } from 'svelte'; - import { clearAllParameters } from '../Utility/parameters'; - import Skeleton from '$lib/Loading/Skeleton.svelte'; - import InputTemplate from './InputTemplate.svelte'; - import tooltip from '$lib/Tooltip/tooltip'; + import { threads } from '$lib/Data/AniList/forum'; + import { onMount } from 'svelte'; + import { clearAllParameters } from '../Utility/parameters'; + import Skeleton from '$lib/Loading/Skeleton.svelte'; + import InputTemplate from './InputTemplate.svelte'; + import tooltip from '$lib/Tooltip/tooltip'; - let submission = ''; + let submission = ''; - onMount(clearAllParameters); + onMount(clearAllParameters); </script> <InputTemplate - field="Username" - bind:submission - event="Collect Episode Discussions" - submitText="Search" + field="Username" + bind:submission + event="Collect Episode Discussions" + submitText="Search" > - {#if submission !== ''} - {#await threads(submission)} - <Skeleton card={false} count={5} height="0.9rem" list /> - {:then threads} - <ul> - {#each threads - .filter((thread) => thread.title.includes('[Spoilers]') && thread.title.includes('Episode')) - .sort((a, b) => b.createdAt - a.createdAt) as thread} - <li> - <span class="opaque" style="white-space: pre;"> - {new Date(thread.createdAt * 1000).toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric' - })} - </span> - <a - href={`https://anilist.co/forum/thread/${thread.id}`} - target="_blank" - title={`<img src="${thread.mediaCategories[0].coverImage.extraLarge}" style="width: 250px; object-fit: cover; border-radius: 8px;" />`} - use:tooltip - > - {thread.title.replace('[Spoilers]', '')} - </a> - </li> - {/each} - </ul> - {:catch} - <p>Threads could not be loaded. You might have been rate-limited.</p> - <p> - Try again in a few minutes. If the problem persists, please contact <a - href="https://anilist.co/user/fuwn" - target="_blank">@fuwn</a - > on AniList. - </p> - {/await} - {:else} - <p /> + {#if submission !== ''} + {#await threads(submission)} + <Skeleton card={false} count={5} height="0.9rem" list /> + {:then threads} + <ul> + {#each threads + .filter((thread) => thread.title.includes('[Spoilers]') && thread.title.includes('Episode')) + .sort((a, b) => b.createdAt - a.createdAt) as thread} + <li> + <span class="opaque" style="white-space: pre;"> + {new Date(thread.createdAt * 1000).toLocaleDateString('en-US', { + month: 'short', + day: 'numeric', + year: 'numeric' + })} + </span> + <a + href={`https://anilist.co/forum/thread/${thread.id}`} + target="_blank" + title={`<img src="${thread.mediaCategories[0].coverImage.extraLarge}" style="width: 250px; object-fit: cover; border-radius: 8px;" />`} + use:tooltip + > + {thread.title.replace('[Spoilers]', '')} + </a> + </li> + {/each} + </ul> + {:catch} + <p>Threads could not be loaded. You might have been rate-limited.</p> + <p> + Try again in a few minutes. If the problem persists, please contact <a + href="https://anilist.co/user/fuwn" + target="_blank">@fuwn</a + > on AniList. + </p> + {/await} + {:else} + <p /> - Enter a username to search for to continue. - {/if} + Enter a username to search for to continue. + {/if} </InputTemplate> |