From 99fbfd9848990a16441961732f5f89a6dfb45686 Mon Sep 17 00:00:00 2001 From: Ashish Date: Sat, 30 Dec 2023 22:31:25 +0530 Subject: [PATCH] Change results position --- src/backend/metadata/search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/metadata/search.ts b/src/backend/metadata/search.ts index f7984edc..eb923056 100644 --- a/src/backend/metadata/search.ts +++ b/src/backend/metadata/search.ts @@ -24,8 +24,6 @@ export async function searchForMedia(query: MWQuery): Promise { return formatTMDBMetaToMediaItem(formattedResult); }); - cache.set(query, results, 3600); - results.sort((a, b) => { if (a.poster === undefined) { return 1; @@ -35,6 +33,8 @@ export async function searchForMedia(query: MWQuery): Promise { } return 0; }); + + cache.set(query, results, 3600); // cache results for 1 hour return results; }