From 2abb58aa53650d91765dff9f615a3988aded0f59 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sat, 18 Nov 2023 23:53:40 -0800
Subject: refactor(anime): chains functions

---
 src/lib/List/Anime/UpcomingAnimeList.svelte | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

(limited to 'src/lib/List/Anime/UpcomingAnimeList.svelte')

diff --git a/src/lib/List/Anime/UpcomingAnimeList.svelte b/src/lib/List/Anime/UpcomingAnimeList.svelte
index de148c20..e4acc457 100644
--- a/src/lib/List/Anime/UpcomingAnimeList.svelte
+++ b/src/lib/List/Anime/UpcomingAnimeList.svelte
@@ -29,14 +29,13 @@
 					(media.status === 'RELEASING' || media.status === 'NOT_YET_RELEASED') &&
 					media.nextAiringEpisode !== null
 			)
-			.filter((media: Media) => {
-				// Outdated media
-				return (
+			.filter(
+				(media: Media) =>
+					// Outdated media
 					($settings.displayPlannedAnime ? media.mediaListEntry?.status === 'PLANNING' : false) ||
 					(media.nextAiringEpisode || { episode: 0 }).episode - 1 <=
 						(media.mediaListEntry || { progress: 0 }).progress
-				);
-			})
+			)
 			.map((media: Media) => {
 				// Adjust for planned anime
 				if (
@@ -55,16 +54,13 @@
 			);
 		}
 
-		upcomingAnime.sort((a: Media, b: Media) => {
-			return (
+		upcomingAnime.sort(
+			(a: Media, b: Media) =>
 				(a.nextAiringEpisode?.timeUntilAiring || 9999) -
 				(b.nextAiringEpisode?.timeUntilAiring || 9999)
-			);
-		});
+		);
 
-		if (!endTime) {
-			endTime = performance.now() - startTime;
-		}
+		if (!endTime) endTime = performance.now() - startTime;
 
 		return upcomingAnime;
 	};
-- 
cgit v1.2.3

