blob: d325895a0b60a8c0311bf6b17f9b3724dac17438 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<script lang="ts">
/* eslint svelte/no-at-html-tags: "off" */
import type { AniListAuthorisation, UserIdentity } from '$lib/AniList/identity';
import type { Media } from '$lib/AniList/media';
import Error from '$lib/Error.svelte';
import settings from '../../../stores/settings';
import CleanAnimeList from './CleanAnimeList.svelte';
import ListTitle from '../ListTitle.svelte';
export let endTime: number;
export let cleanMedia: (
media: Media[],
displayUnresolved: boolean,
plannedOnly?: boolean
) => Media[];
export let animeLists: Promise<Media[]>;
export let user: AniListAuthorisation;
export let identity: UserIdentity;
export let title: string;
export let completed = false;
export let plannedOnly = false;
let lastUpdatedMedia = -1;
let previousAnimeList: Media[];
let pendingUpdate: number | null = null;
</script>
{#await animeLists}
{#if previousAnimeList}
<CleanAnimeList
media={previousAnimeList}
{title}
bind:animeLists
{user}
{identity}
{endTime}
bind:lastUpdatedMedia
{completed}
bind:previousAnimeList
bind:pendingUpdate
/>
{:else}
<ListTitle custom={title} />
<ul><li>Loading ...</li></ul>
{/if}
{:then media}
<CleanAnimeList
media={cleanMedia(media, $settings.displayUnresolved, plannedOnly)}
{title}
bind:animeLists
{user}
{identity}
{endTime}
bind:lastUpdatedMedia
{completed}
bind:previousAnimeList
bind:pendingUpdate
/>
{:catch}
<ListTitle time={0} count={-1337} custom={title} />
<Error />
{/await}
|