Changed tmdb constructor to have apiKey as first parameter. If cache is not defined we use redis.
This commit is contained in:
@@ -27,9 +27,10 @@ const tmdbErrorResponse = (error, typeString=undefined) => {
|
||||
}
|
||||
|
||||
class TMDB {
|
||||
constructor(cache, apiKey, tmdbLibrary) {
|
||||
this.cache = cache || redisCache;
|
||||
constructor(apiKey, cache, tmdbLibrary) {
|
||||
this.tmdbLibrary = tmdbLibrary || moviedb(apiKey);
|
||||
|
||||
this.cache = cache || redisCache;
|
||||
this.cacheTags = {
|
||||
multiSearch: 'mus',
|
||||
movieSearch: 'mos',
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
|
||||
// there should be a translate function from query params to
|
||||
// tmdb list that is valid. Should it be a helper function or does it
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
|
||||
const movieCreditsController = (req, res) => {
|
||||
const movieId = req.params.id;
|
||||
@@ -23,4 +21,4 @@ const movieCreditsController = (req, res) => {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = movieCreditsController;
|
||||
module.exports = movieCreditsController;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const Plex = require('src/plex/plex');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
const plex = new Plex(configuration.get('plex', 'ip'));
|
||||
|
||||
function handleError(error, res) {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
|
||||
const movieReleaseDatesController = (req, res) => {
|
||||
const movieId = req.params.id;
|
||||
@@ -23,4 +21,4 @@ const movieReleaseDatesController = (req, res) => {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = movieReleaseDatesController;
|
||||
module.exports = movieReleaseDatesController;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
|
||||
/**
|
||||
* Controller: Retrieve information for a person
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const SearchHistory = require('src/searchHistory/searchHistory');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
const searchHistory = new SearchHistory();
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const SearchHistory = require('src/searchHistory/searchHistory');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
const searchHistory = new SearchHistory();
|
||||
|
||||
function checkAndCreateJsonResponse(result) {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const SearchHistory = require('src/searchHistory/searchHistory');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
const searchHistory = new SearchHistory();
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const SearchHistory = require('src/searchHistory/searchHistory');
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
const searchHistory = new SearchHistory();
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
|
||||
const showCreditsController = (req, res) => {
|
||||
const showId = req.params.id;
|
||||
@@ -23,4 +20,4 @@ const showCreditsController = (req, res) => {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = showCreditsController;
|
||||
module.exports = showCreditsController;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const Cache = require('src/tmdb/cache');
|
||||
const TMDB = require('src/tmdb/tmdb');
|
||||
const Plex = require('src/plex/plex');
|
||||
const cache = new Cache();
|
||||
const tmdb = new TMDB(cache, configuration.get('tmdb', 'apiKey'));
|
||||
const tmdb = new TMDB(configuration.get('tmdb', 'apiKey'));
|
||||
const plex = new Plex(configuration.get('plex', 'ip'));
|
||||
|
||||
function handleError(error, res) {
|
||||
|
||||
Reference in New Issue
Block a user