aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-23 18:45:42 -0800
committerFuwn <[email protected]>2023-12-23 18:45:42 -0800
commitae63734fd311824dfe5c8314f214f5153fbb1d34 (patch)
treed304fa1d06a35ec4c653969fa79273e77f963306 /src
parentfeat(wrapped): manual tag and genre calculation (diff)
downloaddue.moe-ae63734fd311824dfe5c8314f214f5153fbb1d34.tar.xz
due.moe-ae63734fd311824dfe5c8314f214f5153fbb1d34.zip
feat(wrapped): genre and tag count options
Diffstat (limited to 'src')
-rw-r--r--src/lib/Tools/Wrapped.svelte19
1 files changed, 17 insertions, 2 deletions
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()}`);
@@ -84,6 +86,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;
if (excludedKeywords.length > 0 && animeList !== undefined && mangaList !== undefined) {
@@ -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}
</select>
Highest rated media count<br />
+ <select bind:value={genreTagCount}>
+ {#each [3, 4, 5, 6, 7, 8, 9, 10] as count}
+ <option value={count}>{count}</option>
+ {/each}
+ </select>
+ Highest genre and tag count<br />
<button on:click={updateWidth}>Find best fit</button>
<button on:click={() => (width -= 25)}>-25px</button>
<button on:click={() => (width += 25)}>+25px</button>