From 2581ef653a0ab8f9583d3135c1a8f82775cb1e1b Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 29 Dec 2023 21:17:57 -0800
Subject: feat(wrapped): genre tags sort options

---
 src/lib/Tools/Wrapped.svelte | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/lib/Tools/Wrapped.svelte')

diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte
index 4f05626f..2ec74a42 100644
--- a/src/lib/Tools/Wrapped.svelte
+++ b/src/lib/Tools/Wrapped.svelte
@@ -5,7 +5,7 @@
 		type AniListAuthorisation
 	} from '$lib/AniList/identity';
 	import { onMount } from 'svelte';
-	import { tops, wrapped, type TopMedia } from '$lib/AniList/wrapped';
+	import { tops, wrapped, type TopMedia, SortOptions } from '$lib/AniList/wrapped';
 	import {
 		fullActivityHistory,
 		activityHistory as getActivityHistory
@@ -58,6 +58,7 @@
 	let topMedia: TopMedia;
 	let highestRatedMediaPercentage = true;
 	let highestRatedGenreTagPercentage = true;
+	let genreTagsSort = SortOptions.SCORE;
 
 	$: {
 		if (browser && mounted) {
@@ -108,6 +109,7 @@
 			topMedia = tops(
 				[...(animeList || []), ...(mangaList || [])],
 				genreTagCount,
+				genreTagsSort,
 				excludedKeywords
 			);
 
@@ -686,6 +688,12 @@
 							<a href={'#'} on:click={pruneFullYear}>Refresh data</a>
 						</SettingHint><br />
 						<p />
+						<select bind:value={genreTagsSort}>
+							<option value={SortOptions.SCORE}>Score</option>
+							<option value={SortOptions.MINUTES_WATCHED}>Minutes Watched</option>
+							<option value={SortOptions.COUNT}>Count</option>
+						</select>
+						Genre and tag sort<br />
 						<input type="checkbox" bind:checked={includeMusic} /> Include music<br />
 						<input type="checkbox" bind:checked={includeRepeats} /> Include rewatches & rereads<br
 						/>
-- 
cgit v1.2.3

