From ee53fae3584143e970754ea5dbeb0de5d0e43c30 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Wed, 10 Jan 2024 01:57:32 -0800
Subject: feat(wrapped): more confirmation of date

---
 src/lib/Tools/Wrapped.svelte | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

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

diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte
index d0ba5105..9605b189 100644
--- a/src/lib/Tools/Wrapped.svelte
+++ b/src/lib/Tools/Wrapped.svelte
@@ -305,7 +305,12 @@
 						? true
 						: item.mediaListEntry?.repeat === 0) &&
 					(item.mediaListEntry?.startedAt.year === selectedYear ||
-						item.mediaListEntry?.completedAt.year === selectedYear) &&
+						item.mediaListEntry?.completedAt.year === selectedYear ||
+						((item.mediaListEntry?.createdAt
+							? new Date(item.mediaListEntry?.createdAt * 1000).getFullYear() === selectedYear
+							: false) && item.mediaListEntry
+							? item.mediaListEntry?.progress >= 1
+							: false)) &&
 					(includeMovies ? true : item.format !== 'MOVIE') &&
 					(includeSpecials ? true : item.format !== 'SPECIAL') &&
 					(includeOVAs ? true : item.format !== 'OVA')
@@ -346,7 +351,12 @@
 					self.findIndex((itemToCompare) => itemToCompare.id === item.id) === index &&
 					(includeRepeats ? true : item.mediaListEntry?.repeat === 0) &&
 					(item.mediaListEntry?.startedAt.year === selectedYear ||
-						item.mediaListEntry?.completedAt.year === selectedYear)
+						item.mediaListEntry?.completedAt.year === selectedYear ||
+						((item.mediaListEntry?.createdAt
+							? new Date(item.mediaListEntry?.createdAt * 1000).getFullYear() === selectedYear
+							: false) && item.mediaListEntry
+							? item.mediaListEntry?.progress >= 1
+							: false))
 			)
 			.sort((a, b) => {
 				if (a.mediaListEntry?.score === undefined) return 1;
-- 
cgit v1.2.3

