Cleanup, removed comments and logs.

This commit is contained in:
2020-04-08 23:07:04 +02:00
parent 589bd7b08d
commit 505b126043
3 changed files with 5 additions and 11 deletions

View File

@@ -139,7 +139,6 @@ class Plex {
}
return new Promise((resolve, reject) => this.cache.get(cacheKey)
.then(resolve) // if found in cache resolve
.catch(() => fetch(url, options)) // else fetch fresh data
.then(successfullResponse)
.then(results => this.cache.set(cacheKey, results, 21600))
@@ -157,7 +156,6 @@ class Plex {
mapResults(response) {
if (response == null || response.MediaContainer == null || response.MediaContainer.Hub == null) {
console.log('No results to map in:', response)
return []
}
@@ -173,7 +171,6 @@ class Plex {
}
})
.filter(result => result !== undefined)
// .flat()
}
}

View File

@@ -3,7 +3,6 @@ const RedisCache = require('src/cache/redis')
const redisCache = new RedisCache()
const { Movie, Show, Person, Credits, ReleaseDates } = require('src/tmdb/types');
// const { tmdbInfo } = require('src/tmdb/types')
const tmdbErrorResponse = (error, typeString=undefined) => {
if (error.status === 404) {
@@ -225,8 +224,6 @@ class TMDB {
* @returns {Promise} dict with tmdb results, mapped as movie/show objects.
*/
mapResults(response, type=undefined) {
// console.log(response.results)
// response.results.map(te => console.table(te))
let results = response.results.map(result => {
if (type === 'movie' || result.media_type === 'movie') {

View File

@@ -1,7 +1,7 @@
import Movie from './types/movie.js'
import Show from './types/show.js'
import Person from './types/person.js'
import Credits from './types/credits.js'
import ReleaseDates from './types/releaseDates.js'
const Movie = require('./types/movie.js')
const Show = require('./types/show.js')
const Person = require('./types/person.js')
const Credits = require('./types/credits.js')
const ReleaseDates = require('./types/releaseDates.js')
module.exports = { Movie, Show, Person, Credits, ReleaseDates }