From ae63734fd311824dfe5c8314f214f5153fbb1d34 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 23 Dec 2023 18:45:42 -0800 Subject: feat(wrapped): genre and tag count options --- src/lib/Tools/Wrapped.svelte | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/lib/Tools') diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index 69aca735..2bbfdce9 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -44,6 +44,7 @@ let width = 980; let lightMode = false; let highestRatedCount = 5; + let genreTagCount = 5; let mounted = false; let generated = false; let disableActivityHistory = true; @@ -64,6 +65,7 @@ $page.url.searchParams.set('width', width.toString()); $page.url.searchParams.set('lightMode', lightMode.toString()); $page.url.searchParams.set('highestRatedCount', highestRatedCount.toString()); + $page.url.searchParams.set('genreTagCount', genreTagCount.toString()); $page.url.searchParams.set('disableActivityHistory', disableActivityHistory.toString()); history.replaceState(null, '', `?${$page.url.searchParams.toString()}`); @@ -83,6 +85,13 @@ new Promise((resolve) => setTimeout(resolve, 1)).then(updateWidth); } + $: { + genreTagCount = genreTagCount; + + if (animeList && mangaList) topMedia = tops([...animeList, ...mangaList], genreTagCount); + + // new Promise((resolve) => setTimeout(resolve, 1)).then(updateWidth); + } $: { excludedKeywords = excludedKeywords; @@ -152,6 +161,7 @@ 'width', 'forceDark', 'highestRatedCount', + 'genreTagCount', 'disableActivityHistory' ]); @@ -165,6 +175,7 @@ width = parseInt($page.url.searchParams.get('width') || '980', 10); lightMode = $page.url.searchParams.get('lightMode') === 'true'; highestRatedCount = parseInt($page.url.searchParams.get('highestRatedCount') || '5', 10); + genreTagCount = parseInt($page.url.searchParams.get('genreTagCount') || '5', 10); disableActivityHistory = $page.url.searchParams.get('disableActivityHistory') === 'true'; } @@ -245,8 +256,6 @@ } for (const media of mangaList) chapters += media.mediaListEntry?.progress || 0; - - topMedia = tops([...animeList, ...mangaList], 5); }; /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -625,6 +634,12 @@ {/each} Highest rated media count
+ + Highest genre and tag count
-- cgit v1.2.3