Changed the filter cutoff to be based on, if the show/movie has popularity over 2, vote_count over 20 and has a defined release_date/first_air_date. Also changed so that it now uses the new convertTmdbToSeaonsed insted of the old (convertTmdbToMovie)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
const moviedb = require('moviedb');
|
const moviedb = require('moviedb');
|
||||||
const convertTmdbToMovie = require('src/tmdb/convertTmdbToMovie');
|
const convertTmdbToSeasoned = require('src/tmdb/convertTmdbToSeasoned');
|
||||||
var methodTypes = { 'movie': 'searchMovie', 'tv': 'searchTv', 'multi': 'searchMulti', 'movieInfo': 'movieInfo',
|
var methodTypes = { 'movie': 'searchMovie', 'tv': 'searchTv', 'multi': 'searchMulti', 'movieInfo': 'movieInfo',
|
||||||
'tvInfo': 'tvInfo' };
|
'tvInfo': 'tvInfo' };
|
||||||
|
|
||||||
@@ -16,8 +16,8 @@ class TMDB {
|
|||||||
.then((reponse) => {
|
.then((reponse) => {
|
||||||
try {
|
try {
|
||||||
return reponse.results.filter(function(item) {
|
return reponse.results.filter(function(item) {
|
||||||
return (item.popularity >= 1.15)
|
return ((item.vote_count >= 20 || item.popularity > 2) && (item.release_date !== undefined || item.first_air_date !== undefined))
|
||||||
}).map(convertTmdbToMovie);
|
}).map(convertTmdbToSeasoned);
|
||||||
} catch (parseError) {
|
} catch (parseError) {
|
||||||
throw new Error('Could not parse result.');
|
throw new Error('Could not parse result.');
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ class TMDB {
|
|||||||
.catch(() => { throw new Error('Could not find a movie with that id.'); })
|
.catch(() => { throw new Error('Could not find a movie with that id.'); })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
try {
|
try {
|
||||||
return convertTmdbToMovie(response);
|
return convertTmdbToSeasoned(response);
|
||||||
} catch (parseError) {
|
} catch (parseError) {
|
||||||
throw new Error('Could not parse movie.');
|
throw new Error('Could not parse movie.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user