Now the type is checked and passed to convertTmdbToSeasoned if it is movie or show and not multiwq

This commit is contained in:
2017-09-21 16:37:53 +02:00
parent 743c132aef
commit e281e73293

View File

@@ -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;
module.exports = TMDB;