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

Update src/backend/metadata/search.ts

Co-authored-by: William Oldham <github@binaryoverload.co.uk>
This commit is contained in:
Ashish 2024-01-02 15:43:02 +05:30 committed by GitHub
parent 897d856ba5
commit 5bf7c82b54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,10 +24,10 @@ export async function searchForMedia(query: MWQuery): Promise<MediaItem[]> {
return formatTMDBMetaToMediaItem(formattedResult);
});
const movieWithposters = results.filter((movie) => movie.poster);
const movieWithoutposters = results.filter((movie) => !movie.poster);
const movieWithPosters = results.filter((movie) => movie.poster);
const movieWithoutPosters = results.filter((movie) => !movie.poster);
const sortedresult = movieWithposters.concat(movieWithoutposters);
const sortedresult = movieWithPosters.concat(movieWithoutPosters);
// cache results for 1 hour
cache.set(query, sortedresult, 3600);