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);