aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-26 23:44:41 -0800
committerFuwn <[email protected]>2023-12-26 23:44:41 -0800
commit4792d6c5fd628e9a455ef461d89b268a7ef114b3 (patch)
tree864c73df2c99c4cf48ea478461b9393041402d8d /src/lib/List
parentstyle(settings.json): prettier (diff)
downloaddue.moe-4792d6c5fd628e9a455ef461d89b268a7ef114b3.tar.xz
due.moe-4792d6c5fd628e9a455ef461d89b268a7ef114b3.zip
feat(manga): distributed proxy
Diffstat (limited to 'src/lib/List')
-rw-r--r--src/lib/List/Manga/MangaListTemplate.svelte139
1 files changed, 65 insertions, 74 deletions
diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte
index 256a4900..4e92acd8 100644
--- a/src/lib/List/Manga/MangaListTemplate.svelte
+++ b/src/lib/List/Manga/MangaListTemplate.svelte
@@ -12,7 +12,6 @@
import Error from '$lib/Error/RateLimited.svelte';
import CleanMangaList from './CleanMangaList.svelte';
import authorisedJson from '$lib/authorised.json';
- import serviceSettings from '$lib/settings.json';
export let user: AniListAuthorisation;
export let identity: UserIdentity;
@@ -168,14 +167,42 @@
};
</script>
-{#if serviceSettings.disabled}
- <ListTitle />
+{#await mangaLists}
+ {#if !authorised}
+ <ListTitle count={0} time={endTime / 1000}>
+ <a
+ href={'#'}
+ title="Force a full refresh"
+ on:click={() => {
+ cleanCache();
+
+ forceFlag = true;
+ }}>Refresh</a
+ >
+ </ListTitle>
+ {/if}
+
+ {#if previousMangaList}
+ <CleanMangaList
+ media={previousMangaList}
+ {cleanCache}
+ {lastUpdatedMedia}
+ {updateMedia}
+ {endTime}
+ {pendingUpdate}
+ {due}
+ {rateLimited}
+ {authorised}
+ />
+ {:else}
+ {#if authorised}
+ <ListTitle />
+ {/if}
- <ul>
- <li>Manga is currently unavailable due to API abuse. Check back later.</li>
- </ul>
-{:else}
- {#await mangaLists}
+ <ul><li>Loading {progress.toFixed(0)}% ...</li></ul>
+ {/if}
+{:then media}
+ {#await cleanMedia(media, displayUnresolved, forceFlag)}
{#if !authorised}
<ListTitle count={0} time={endTime / 1000}>
<a
@@ -209,73 +236,37 @@
<ul><li>Loading {progress.toFixed(0)}% ...</li></ul>
{/if}
- {:then media}
- {#await cleanMedia(media, displayUnresolved, forceFlag)}
- {#if !authorised}
- <ListTitle count={0} time={endTime / 1000}>
- <a
- href={'#'}
- title="Force a full refresh"
- on:click={() => {
- cleanCache();
-
- forceFlag = true;
- }}>Refresh</a
- >
- </ListTitle>
- {/if}
+ {:then cleanedMedia}
+ {#if !authorised}
+ <ListTitle count={cleanedMedia.length} time={endTime / 1000}>
+ <a
+ href={'#'}
+ title="Force a full refresh"
+ on:click={() => {
+ cleanCache();
- {#if previousMangaList}
- <CleanMangaList
- media={previousMangaList}
- {cleanCache}
- {lastUpdatedMedia}
- {updateMedia}
- {endTime}
- {pendingUpdate}
- {due}
- {rateLimited}
- {authorised}
- />
- {:else}
- {#if authorised}
- <ListTitle />
- {/if}
-
- <ul><li>Loading {progress.toFixed(0)}% ...</li></ul>
- {/if}
- {:then cleanedMedia}
- {#if !authorised}
- <ListTitle count={cleanedMedia.length} time={endTime / 1000}>
- <a
- href={'#'}
- title="Force a full refresh"
- on:click={() => {
- cleanCache();
-
- forceFlag = true;
- }}>Refresh</a
- >
- </ListTitle>
- {/if}
+ forceFlag = true;
+ }}>Refresh</a
+ >
+ </ListTitle>
+ {/if}
- <CleanMangaList
- media={cleanedMedia}
- {cleanCache}
- {lastUpdatedMedia}
- {updateMedia}
- {endTime}
- {pendingUpdate}
- {due}
- {rateLimited}
- {authorised}
- />
- {:catch}
- {#if authorised}
- <ListTitle count={-1337} time={0} />
- {/if}
+ <CleanMangaList
+ media={cleanedMedia}
+ {cleanCache}
+ {lastUpdatedMedia}
+ {updateMedia}
+ {endTime}
+ {pendingUpdate}
+ {due}
+ {rateLimited}
+ {authorised}
+ />
+ {:catch}
+ {#if authorised}
+ <ListTitle count={-1337} time={0} />
+ {/if}
- <Error />
- {/await}
+ <Error />
{/await}
-{/if}
+{/await}