mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 09:45:07 +01:00
Merge pull request #673 from ashudevcodes/dev
fix: movies with unavailable posters will be shown in the last row
This commit is contained in:
commit
245f4a540f
@ -24,6 +24,12 @@ export async function searchForMedia(query: MWQuery): Promise<MediaItem[]> {
|
||||
return formatTMDBMetaToMediaItem(formattedResult);
|
||||
});
|
||||
|
||||
cache.set(query, results, 3600); // cache results for 1 hour
|
||||
return results;
|
||||
const movieWithPosters = results.filter((movie) => movie.poster);
|
||||
const movieWithoutPosters = results.filter((movie) => !movie.poster);
|
||||
|
||||
const sortedresult = movieWithPosters.concat(movieWithoutPosters);
|
||||
|
||||
// cache results for 1 hour
|
||||
cache.set(query, sortedresult, 3600);
|
||||
return sortedresult;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user