From e281e73293797a472409a69855412515db10f5e4 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Thu, 21 Sep 2017 16:37:53 +0200 Subject: [PATCH] Now the type is checked and passed to convertTmdbToSeasoned if it is movie or show and not multiwq --- seasoned_api/src/tmdb/tmdb.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/seasoned_api/src/tmdb/tmdb.js b/seasoned_api/src/tmdb/tmdb.js index 3657679..0557a2f 100644 --- a/seasoned_api/src/tmdb/tmdb.js +++ b/seasoned_api/src/tmdb/tmdb.js @@ -31,7 +31,12 @@ class TMDB { // Here we convert the filtered result from the tmdb api to seaonsed objects let seasonedItems = filteredTmdbItems.map((tmdbItem) => { - return convertTmdbToSeasoned(tmdbItem); + if (type === 'movie') + return convertTmdbToSeasoned(tmdbItem, 'movie'); + else if (type === 'show') + return convertTmdbToSeaosned(tmdbItem, 'show'); + else + return convertTmdbToSeasoned(tmdbItem); }); // TODO add page number if results are larger than 20 @@ -294,4 +299,4 @@ class TMDB { } } -module.exports = TMDB; \ No newline at end of file +module.exports = TMDB;