From 98e56b5c829d8ca01d343c9e29df05e3996f70a2 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 16 Nov 2023 10:39:39 -0800
Subject: refactor(wrapped): merge filters

---
 src/lib/Tools/Wrapped.svelte | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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

diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte
index d530dcaf..1d0c6761 100644
--- a/src/lib/Tools/Wrapped.svelte
+++ b/src/lib/Tools/Wrapped.svelte
@@ -50,9 +50,9 @@
 			)
 				.filter(
 					(item, index, self) =>
-						self.findIndex((itemToCompare) => itemToCompare.id === item.id) === index
+						self.findIndex((itemToCompare) => itemToCompare.id === item.id) === index &&
+						item.mediaListEntry?.startedAt.year === currentYear
 				)
-				.filter((m) => m.mediaListEntry?.startedAt.year === currentYear)
 				.sort((a, b) => {
 					if (a.mediaListEntry?.score === undefined) {
 						return 1;
@@ -75,9 +75,9 @@
 			)
 				.filter(
 					(item, index, self) =>
-						self.findIndex((itemToCompare) => itemToCompare.id === item.id) === index
+						self.findIndex((itemToCompare) => itemToCompare.id === item.id) === index &&
+						item.mediaListEntry?.startedAt.year === currentYear
 				)
-				.filter((m) => m.mediaListEntry?.startedAt.year === currentYear)
 				.sort((a, b) => {
 					if (a.mediaListEntry?.score === undefined) {
 						return 1;
-- 
cgit v1.2.3

