Change results position

This commit is contained in:
Ashish 2023-12-30 22:31:25 +05:30 committed by GitHub
parent 86feacbfa2
commit 99fbfd9848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,8 +24,6 @@ export async function searchForMedia(query: MWQuery): Promise<MediaItem[]> {
return formatTMDBMetaToMediaItem(formattedResult); return formatTMDBMetaToMediaItem(formattedResult);
}); });
cache.set(query, results, 3600);
results.sort((a, b) => { results.sort((a, b) => {
if (a.poster === undefined) { if (a.poster === undefined) {
return 1; return 1;
@ -35,6 +33,8 @@ export async function searchForMedia(query: MWQuery): Promise<MediaItem[]> {
} }
return 0; return 0;
}); });
cache.set(query, results, 3600);
// cache results for 1 hour // cache results for 1 hour
return results; return results;
} }