diff --git a/src/backend/metadata/search.ts b/src/backend/metadata/search.ts index a162dd3a..fff64112 100644 --- a/src/backend/metadata/search.ts +++ b/src/backend/metadata/search.ts @@ -24,6 +24,12 @@ export async function searchForMedia(query: MWQuery): Promise { 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; }