If a strict type is passed to convertTmdbToSeasoned than this is now used to set the type of objects to be made.

This commit is contained in:
2017-09-21 16:37:10 +02:00
parent 4c2982293b
commit 743c132aef

View File

@@ -2,7 +2,10 @@ const Movie = require('src/media_classes/movie');
const Show = require('src/media_classes/show');
function convertTmdbToSeasoned(tmdbObject, strictType=undefined) {
const mediaType = strictType || tmdbObject.media_type;
if (strictType === undefined)
var mediaType = tmdbObject.media_type;
else
var mediaType = strictType;
// There are many diff types of content, we only want to look at movies and tv shows
if (mediaType === 'movie') {
@@ -47,4 +50,5 @@ function convertTmdbToSeasoned(tmdbObject, strictType=undefined) {
}
}
module.exports = convertTmdbToSeasoned;
module.exports = convertTmdbToSeasoned;