mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-25 17:31:52 +01:00
Update src/backend/metadata/search.ts
Co-authored-by: William Oldham <github@binaryoverload.co.uk>
This commit is contained in:
parent
897d856ba5
commit
5bf7c82b54
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user