1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-30 16:17:41 +01:00

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);
});
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<MediaItem[]> {
}
return 0;
});
cache.set(query, results, 3600);
// cache results for 1 hour
return results;
}