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:
@@ -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') {
|
||||
@@ -48,3 +51,4 @@ function convertTmdbToSeasoned(tmdbObject, strictType=undefined) {
|
||||
}
|
||||
|
||||
module.exports = convertTmdbToSeasoned;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user