aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/List/Anime/CleanAnimeList.svelte4
-rw-r--r--src/lib/List/Anime/CompletedAnimeList.svelte14
2 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte
index 175b138c..f36bb8d0 100644
--- a/src/lib/List/Anime/CleanAnimeList.svelte
+++ b/src/lib/List/Anime/CleanAnimeList.svelte
@@ -36,6 +36,8 @@
let keyCacher: NodeJS.Timeout;
onMount(() => {
+ if (dummy) return;
+
keyCacher = setInterval(
() => {
media = media;
@@ -150,7 +152,7 @@
}
}}>+</button
>
- {#if !completed}
+ {#if !completed || dummy}
[{anime.nextAiringEpisode?.episode === -1
? '?'
: (anime.nextAiringEpisode?.episode || 1) - 1}]
diff --git a/src/lib/List/Anime/CompletedAnimeList.svelte b/src/lib/List/Anime/CompletedAnimeList.svelte
index 67e917b6..29d62724 100644
--- a/src/lib/List/Anime/CompletedAnimeList.svelte
+++ b/src/lib/List/Anime/CompletedAnimeList.svelte
@@ -44,11 +44,23 @@
)
.sort(() => 0.5 - Math.random())
.map((anime) => {
- anime.mediaListEntry.progress = Math.floor(Math.random() * (anime.episodes || 0)) + 1;
+ const nextEpisode = Math.floor(Math.random() * (anime.episodes || 0)) + 1 || 1;
+
anime.status = 'FINISHED';
+ anime.nextAiringEpisode = {
+ airingAt:
+ Math.floor(Date.now() / 1000) +
+ Math.floor(Math.random() * 7 * 24 * 60 * 60) +
+ 60 * 60,
+ episode: Math.floor(Math.random() * (anime.episodes || 0)) + 1 || 1
+ };
+ anime.mediaListEntry.progress = Math.floor(Math.random() * nextEpisode) || 1;
return anime;
})
+ .sort(
+ (a, b) => (a.nextAiringEpisode?.airingAt || 0) - (b.nextAiringEpisode?.airingAt || 0)
+ )
.slice(0, 7) as unknown as Media[]
);
} else {