From 6564948af8a5be1dd79e9dee37058a08da4a1d60 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 13:38:25 +0100 Subject: [PATCH 1/8] Split up our plex and tmdb classes into more logical files with a common media class that it extends off of. --- seasoned_api/src/media_classes/media.js | 19 ++++++++++++++ seasoned_api/src/media_classes/plex.js | 22 +++++++++++++++++ seasoned_api/src/media_classes/tmdb.js | 33 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 seasoned_api/src/media_classes/media.js create mode 100644 seasoned_api/src/media_classes/plex.js create mode 100644 seasoned_api/src/media_classes/tmdb.js diff --git a/seasoned_api/src/media_classes/media.js b/seasoned_api/src/media_classes/media.js new file mode 100644 index 0000000..4ec1627 --- /dev/null +++ b/seasoned_api/src/media_classes/media.js @@ -0,0 +1,19 @@ + +class Media { + constructor(title, year, type) { + this.title = title; + this.year = year; + this.type = type; + } + + toString() { + return `N: ${this.title} | Y: ${this.year} | T: ${this.type}`; + } + + print() { + /* eslint-disable no-console */ + console.log(this.toString()); + } +} + +module.exports = Media; diff --git a/seasoned_api/src/media_classes/plex.js b/seasoned_api/src/media_classes/plex.js new file mode 100644 index 0000000..57528b1 --- /dev/null +++ b/seasoned_api/src/media_classes/plex.js @@ -0,0 +1,22 @@ + +const Media = require('src/media_classes/media'); + +class Plex extends Media { + constructor(title, year, type, summary, poster_path, background_path, added, seasons, episodes) { + super(title, year, type); + + this.summary = summary; + this.poster_path = poster_path; + this.background_path = background_path; + this.added = added; + + this.seasons = seasons; + this.episodes = episodes; + } + + print() { + super.print(); + } +} + +module.exports = Plex; diff --git a/seasoned_api/src/media_classes/tmdb.js b/seasoned_api/src/media_classes/tmdb.js new file mode 100644 index 0000000..c1a7dc6 --- /dev/null +++ b/seasoned_api/src/media_classes/tmdb.js @@ -0,0 +1,33 @@ + +const Media = require('src/media_classes/media'); + +class TMDB extends Media { + // constructor(...args) { + constructor(title, year, type, id, summary, poster_path, background_path, popularity, score, release_status, tagline, seasons, episodes) { + super(title, year, type); + + this.id = id; + this.summary = summary; + this.poster_path = poster_path; + this.background_path = background_path; + this.popularity = popularity; + this.score = score; + + this.release_status = release_status; + this.tagline = tagline; + + this.seasons = seasons; + this.episodes = episodes; + } + + toString() { + return `${super.toString()} | ID: ${this.id}`; + } + + print() { + /* eslint-disable no-console */ + console.log(this.toString()); + } +} + +module.exports = TMDB; From 7e874bbc9df7cbbe24c91b6e68c62ed6ec4b1624 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 13:39:45 +0100 Subject: [PATCH 2/8] Now our convert scripts use our new plex and tmdb classes. Also compacted and abstracted a lot of the code here. --- .../src/plex/convertPlexToSeasoned.js | 60 +++++---------- .../src/tmdb/convertTmdbToSeasoned.js | 74 +++++++------------ 2 files changed, 46 insertions(+), 88 deletions(-) diff --git a/seasoned_api/src/plex/convertPlexToSeasoned.js b/seasoned_api/src/plex/convertPlexToSeasoned.js index 026b2f1..023c6f4 100644 --- a/seasoned_api/src/plex/convertPlexToSeasoned.js +++ b/seasoned_api/src/plex/convertPlexToSeasoned.js @@ -1,48 +1,24 @@ -const Movie = require('src/media_classes/movie'); -const Show = require('src/media_classes/show'); +const Plex = require('src/media_classes/plex'); -function convertPlexToSeasoned(plexObject) { +function translateAdded(date_string) { + return new Date(date_string * 1000); +} - const mediaType = plexObject.type; - // There are many diff types of content, we only want to look at movies and tv shows - if (mediaType === 'movie') { - const movie = new Movie(plexObject.title, plexObject.year, mediaType); +function convertPlexToSeasoned(plex) { + const title = plex.title; + const year = plex.year; + const type = plex.type; + const summary = plex.summary; + const poster_path = plex.thumb; + const background_path = plex.art; + const added = translateAdded(plex.addedAt); + // const genre = plex.genre; + const seasons = plex.childCount; + const episodes = plex.leafCount; - movie.summary = plexObject.summary; - movie.rating = plexObject.rating; - movie.poster = plexObject.thumb; - movie.background = plexObject.art; - movie.genre = plexObject.genre; - movie.added = new Date(plexObject.addedAt * 1000); - - movie.mediaInfo = plexObject.Media; - - // Don't need a for-loop when we have it in json format - file_sizes = [] - for (let movie_info of plexObject.Media) { - for (let file_data of movie_info.Part) { - file_sizes.push(file_data.size) - } - } - movie.size = file_sizes; - - return movie; - } - else if (mediaType === 'show') { - const show = new Show(plexObject.title, plexObject.year, mediaType); - - show.summary = plexObject.summary; - show.rating = plexObject.rating; - show.poster = plexObject.thumb; - show.background = plexObject.art; - show.genre = plexObject.genre; - show.added = new Date(plexObject.addedAt * 1000); - - show.seasons = plexObject.childCount; - show.episodes = plexObject.leafCount; - - return show; - } + const seasoned = new Plex(title, year, type, summary, poster_path, background_path, added, seasons, episodes); + // seasoned.print(); + return seasoned; } module.exports = convertPlexToSeasoned; diff --git a/seasoned_api/src/tmdb/convertTmdbToSeasoned.js b/seasoned_api/src/tmdb/convertTmdbToSeasoned.js index c5ced79..9fcbd4c 100644 --- a/seasoned_api/src/tmdb/convertTmdbToSeasoned.js +++ b/seasoned_api/src/tmdb/convertTmdbToSeasoned.js @@ -1,57 +1,39 @@ -const Movie = require('src/media_classes/movie'); -const Show = require('src/media_classes/show'); -function convertTmdbToSeasoned(tmdbObject, strictType=undefined) { - // TODO create a default fallback class to set the when falls to else as both are undefined - if (tmdbObject.media_type !== undefined) - var mediaType = tmdbObject.media_type; - else if (strictType !== undefined) - var mediaType = strictType; - else - var mediaType = 'movie'; +const TMDB = require('src/media_classes/tmdb'); - // There are many diff types of content, we only want to look at movies and tv shows - if (mediaType === 'movie') { - const year = new Date(tmdbObject.release_date).getFullYear(); +function translateYear(tmdbReleaseDate) { + return new Date(tmdbReleaseDate).getFullYear(); +} - if (tmdbObject.title !== undefined) { - var title = tmdbObject.title; - } else if (tmdbObject.name !== undefined) { - var title = tmdbObject.name; - } +function translateGenre(tmdbGenres) { + return tmdbGenres.map(genre => genre.name); +} - const movie = new Movie(title, year, mediaType); +function convertTmdbToSeasoned(tmdb, manualType = undefined) { + const title = tmdb.title || tmdb.name; + const year = translateYear(tmdb.release_date || tmdb.first_air_date); + const type = tmdb.media_type || manualType; - movie.id = tmdbObject.id; - movie.summary = tmdbObject.overview; - movie.rating = tmdbObject.vote_average; - movie.poster_path = tmdbObject.poster_path; - movie.background_path = tmdbObject.backdrop_path; - movie.genre = tmdbObject.genre_ids; + const id = tmdb.id; + const summary = tmdb.overview; + const poster_path = tmdb.poster_path; + const background_path = tmdb.backdrop_path; + const popularity = tmdb.popularity; + const score = tmdb.vote_average; + // const genres = translateGenre(tmdb.genres); + const release_status = tmdb.status; + const tagline = tmdb.tagline; - movie.popularity = tmdbObject.popularity; - movie.vote_count = tmdbObject.vote_count; + const seasons = tmdb.number_of_seasons; + const episodes = tmdb.episodes; - return movie; - } - else if (mediaType === 'tv' || mediaType === 'show') { - const year = new Date(tmdbObject.first_air_date).getFullYear(); + const seasoned = new TMDB( + title, year, type, id, summary, poster_path, background_path, + popularity, score, release_status, tagline, seasons, episodes, + ); - const show = new Show(tmdbObject.name, year, 'show'); - - show.id = tmdbObject.id; - show.summary = tmdbObject.overview; - show.rating = tmdbObject.vote_average; - show.poster_path = tmdbObject.poster_path; - show.background_path = tmdbObject.backdrop_path; - show.genre = tmdbObject.genre_ids; - - show.popularity = tmdbObject.popularity; - show.vote_count = tmdbObject.vote_count; - - return show; - } + // seasoned.print() + return seasoned; } module.exports = convertTmdbToSeasoned; - From 6fd65fdb239177c7c8f3467a3add38b2c4669436 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 13:42:46 +0100 Subject: [PATCH 3/8] Refactoring where now we can search lists and lookup movies or shows by using the new tmdbMethod function which takes the api endpoint variable and type to return the appropriate tmdbMethod name for the matching api call to tmdb. Removed a lot of the globally defined variables. --- seasoned_api/src/tmdb/tmdb.js | 272 +++++++++++++++------------------- 1 file changed, 117 insertions(+), 155 deletions(-) diff --git a/seasoned_api/src/tmdb/tmdb.js b/seasoned_api/src/tmdb/tmdb.js index 76b6fd5..79b1e40 100644 --- a/seasoned_api/src/tmdb/tmdb.js +++ b/seasoned_api/src/tmdb/tmdb.js @@ -1,172 +1,134 @@ const moviedb = require('moviedb'); const convertTmdbToSeasoned = require('src/tmdb/convertTmdbToSeasoned'); -var methodTypes = { 'movie': 'searchMovie', 'show': 'searchTv', 'multi': 'searchMulti', 'movieInfo': 'movieInfo', - 'tvInfo': 'tvInfo', 'upcomingMovies': 'miscUpcomingMovies', 'discoverMovie': 'discoverMovie', - 'discoverShow': 'discoverTv', 'popularMovies': 'miscPopularMovies', 'popularShows': 'miscPopularTvs', - 'nowPlayingMovies': 'miscNowPlayingMovies', 'nowAiringShows': 'tvOnTheAir', 'movieSimilar': 'movieSimilar', - 'showSimilar': 'tvSimilar' }; - -const TYPE_LIST = ['upcoming', 'discover', 'popular', 'nowplaying', 'similar'] -const TMDB_TYPE_LIST = { - 'upcomingmovie': 'miscUpcomingMovies', 'discovermovie': 'discoverMovie', - 'discovershow': 'discoverTv', 'popularmovie': 'miscPopularMovies', - 'popularshow': 'miscPopularTvs', 'nowplayingmovie': 'miscNowPlayingMovies', - 'nowplayingshow': 'tvOnTheAir', 'similarmovie': 'movieSimilar', 'similarshow': 'tvSimilar', +const TMDB_METHODS = { + upcoming: { movie: 'miscUpcomingMovies' }, + discover: { movie: 'discoverMovie', show: 'discoverTv' }, + popular: { movie: 'miscPopularMovies', show: 'miscPopularTvs' }, + nowplaying: { movie: 'miscNowPlayingMovies', show: 'tvOnTheAir' }, + similar: { movie: 'movieSimilar', show: 'tvSimilar' }, + search: { movie: 'searchMovie', show: 'searchTv', multi: 'searchMulti' }, + info: { movie: 'movieInfo', show: 'tvInfo' }, }; class TMDB { - constructor(cache, apiKey, tmdbLibrary) { - this.cache = cache - this.tmdbLibrary = tmdbLibrary || moviedb(apiKey); - this.cacheTags = { - 'search': 'se', - 'info': 'i', - 'upcoming': 'u', - 'discover': 'd', - 'popular': 'p', - 'nowplaying': 'n', - 'similar': 'si', - } - } - /** - * Retrive list of of items from TMDB matching the query and/or type given. - * @param {queryText, page, type} the page number to specify in the request for discover, - * @returns {Promise} dict with query results, current page and total_pages - */ - search(text, page = 1, type = 'multi') { - const query = { 'query': text, 'page': page }; - const cacheKey = `${this.cacheTags.search}:${page}:${type}:${text}`; - return Promise.resolve() - .then(() => this.cache.get(cacheKey)) - .catch(() => this.tmdb(methodTypes[type], query)) - .catch(() => { throw new Error('Could not search for movies/shows at tmdb.'); }) - .then((response) => this.cache.set(cacheKey, response)) - .then((response) => this.mapResults(response)) - .catch((error) => { throw new Error(error); }) - .then(([mappedResults, pagenumber, totalpages, total_results]) => { - return {'results': mappedResults, 'page': pagenumber, 'total_results': total_results, 'total_pages': totalpages} - }) - } + constructor(cache, apiKey, tmdbLibrary) { + this.cache = cache; + this.tmdbLibrary = tmdbLibrary || moviedb(apiKey); + this.cacheTags = { + search: 'se', + info: 'i', + upcoming: 'u', + discover: 'd', + popular: 'p', + nowplaying: 'n', + similar: 'si', + }; + } + /** + * Retrieve a specific movie by id from TMDB. + * @param {Number} identifier of the movie you want to retrieve + * @returns {Promise} succeeds if movie was found + */ + lookup(identifier, type = 'movie') { + const query = { id: identifier }; + const cacheKey = `${this.cacheTags.info}:${type}:${identifier}`; + return Promise.resolve() + .then(() => this.cache.get(cacheKey)) + .catch(() => this.tmdb(this.tmdbMethod('info', type), query)) + .catch(() => { throw new Error('Could not find a movie with that id.'); }) + .then(response => this.cache.set(cacheKey, response)) + .then((response) => { + try { + return convertTmdbToSeasoned(response, type); + } catch (parseError) { + console.error(parseError); + throw new Error('Could not parse movie.'); + } + }); + } + /** + * Retrive list of of items from TMDB matching the query and/or type given. + * @param {queryText, page, type} the page number to specify in the request for discover, + * @returns {Promise} dict with query results, current page and total_pages + */ + search(text, page = 1, type = 'multi') { + const query = { query: text, page }; + const cacheKey = `${this.cacheTags.search}:${page}:${type}:${text}`; + return Promise.resolve() + .then(() => this.cache.get(cacheKey)) + .catch(() => this.tmdb(this.tmdbMethod('search', type), query)) + .catch(() => { throw new Error('Could not search for movies/shows at tmdb.'); }) + .then(response => this.cache.set(cacheKey, response)) + .then(response => this.mapResults(response, type)) + .catch((error) => { throw new Error(error); }) + .then(([mappedResults, pagenumber, totalpages, total_results]) => ({ + results: mappedResults, page: pagenumber, total_results, total_pages: totalpages, + })); + } - /** - * Retrieve a specific movie by id from TMDB. - * @param {Number} identifier of the movie you want to retrieve - * @returns {Promise} succeeds if movie was found - */ - lookup(identifier, queryType = 'movie') { - var type, tmdbType; - if (queryType === 'movie' || queryType === 'movieInfo') { type = 'movie', tmdbType = 'movieInfo' } - else if (queryType === 'show' || queryType === 'tvInfo') { type = 'show', tmdbType = 'tvInfo' } - else { - return Promise.resolve() - .then(() => { - throw new Error('Invalid type declaration.') - }) - } - const query = { id: identifier }; - const cacheKey = `${this.cacheTags.lookup}:${type}:${identifier}`; - return Promise.resolve() - .then(() => this.cache.get(cacheKey)) - .catch(() => this.tmdb(tmdbType, query)) - .catch(() => { throw new Error('Could not find a movie with that id.'); }) - .then((response) => this.cache.set(cacheKey, response)) - .then((response) => { - try { - return convertTmdbToSeasoned(response, type); - } catch (parseError) { - throw new Error('Could not parse movie.'); - } - }); - } + /** + * Fetches a given list from tmdb. + * @param {listName} List we want to fetch. + * @param {type} The to specify in the request for discover (default 'movie'). + * @param {id} When finding similar a id can be added to query + * @param {page} Page number we want to fetch. + * @returns {Promise} dict with query results, current page and total_pages + */ + listSearch(listName, type = 'movie', id, page = '1') { + const params = { id, page }; + const cacheKey = `${this.cacheTags[listName]}:${type}:${id}:${page}`; + return Promise.resolve() + .then(() => this.cache.get(cacheKey)) + .catch(() => this.tmdb(this.tmdbMethod(listName, type), params)) + .then(response => this.cache.set(cacheKey, response)) + .then(response => this.mapResults(response, type)) + .catch((error) => { throw new Error(error); }) + .then(([mappedResults, pagenumber, totalpages, total_results]) => ({ + results: mappedResults, page: pagenumber, total_pages: totalpages, total_results, + })); + } - /** - * Verifies that a list_name corresponds to a tmdb list and calls the tmdb - * api with list name and paramters. - * @param {list_name} The name of a list we want to search for. - * @param {media_type} The type declared in listSearch. - * @param {params} Params is page and id given as parameters in listSearch. - * @returns {Promise} dict with raw tmdb results. - */ - searchTmdbList(list_name, media_type, params) { - return new Promise((resolve, reject) => { - if (TYPE_LIST.includes(list_name) && ['movie', 'show'].includes(media_type)) { - const searchQuery = list_name.toLowerCase() + media_type.toLowerCase(); - const tmdbList = TMDB_TYPE_LIST[searchQuery] - - return Promise.resolve() - .then(() => this.tmdb(tmdbList, params)) - .then((response) => { - resolve(response) - }) - .catch(() => { - return reject('Error while fetching from tmdb list.') - }) - } - return reject('Did not find tmdb list matching query.') - }) - } + static tmdbMethod(apiMethod, type) { + const method = TMDB_METHODS[apiMethod][type]; + if (method !== undefined) return method; + throw new Error('Could not find tmdb api method.'); + } - /** - * Maps our response from tmdb api to a movie/show object. - * @param {response} JSON response from tmdb. - * @param {type} The type declared in listSearch. - * @returns {Promise} dict with tmdb results, mapped as movie/show objects. - */ - mapResults(response, type) { - return Promise.resolve() - .then(() => { - const mappedResults = response.results.map((result) => { - return convertTmdbToSeasoned(result, type) - }) - return [mappedResults, response.page, response.total_pages, response.total_results] - }) - .catch((error) => { throw new Error(error)}) + /** + * Maps our response from tmdb api to a movie/show object. + * @param {response} JSON response from tmdb. + * @param {type} The type declared in listSearch. + * @returns {Promise} dict with tmdb results, mapped as movie/show objects. + */ + static mapResults(response, type) { + return Promise.resolve() + .then(() => { + const mappedResults = response.results.map(result => convertTmdbToSeasoned(result, type)); + return [mappedResults, response.page, response.total_pages, response.total_results]; + }) + .catch((error) => { throw new Error(error); }); + } - - } + tmdb(method, argument) { + return new Promise((resolve, reject) => { + const callback = (error, reponse) => { + if (error) { + return reject(error); + } + return resolve(reponse); + }; - /** - * Fetches a given list from tmdb. - * @param {list_name} List we want to fetch. - * @param {media_type} The to specify in the request for discover (default 'movie'). - * @param {id} When finding similar a id can be added to query - * @param {page} Page number we want to fetch. - * @returns {Promise} dict with query results, current page and total_pages - */ - listSearch(list_name, media_type='movie', id, page='1') { - const params = {'id': id, 'page': page} - const cacheKey = `${this.cacheTags[list_name]}:${media_type}:${id}:${page}`; - return Promise.resolve() - .then(() => this.cache.get(cacheKey)) - .catch(() => this.searchTmdbList(list_name, media_type, params)) - .then((response) => this.cache.set(cacheKey, response)) - .then((response) => this.mapResults(response, media_type)) - .catch((error) => { throw new Error(error); }) - .then(([mappedResults, pagenumber, totalpages, total_results]) => { - return {'results': mappedResults, 'page': pagenumber, 'total_pages': totalpages, 'total_results': total_results} - }) - } - - tmdb(method, argument) { - return new Promise((resolve, reject) => { - const callback = (error, reponse) => { - if (error) { - return reject(error); - } - resolve(reponse); - }; - - if (!argument) { - this.tmdbLibrary[method](callback); - } else { - this.tmdbLibrary[method](argument, callback); - } - }) - } + if (!argument) { + this.tmdbLibrary[method](callback); + } else { + this.tmdbLibrary[method](argument, callback); + } + }); + } } module.exports = TMDB; From a40d4f7cd51b4b120181c046acf976cbc3e69925 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 13:44:26 +0100 Subject: [PATCH 4/8] Removed movie and show in replacement with a common media.js and tmdb and plex that extend this media class. --- seasoned_api/src/media_classes/movie.js | 21 --------------------- seasoned_api/src/media_classes/show.js | 22 ---------------------- 2 files changed, 43 deletions(-) delete mode 100644 seasoned_api/src/media_classes/movie.js delete mode 100644 seasoned_api/src/media_classes/show.js diff --git a/seasoned_api/src/media_classes/movie.js b/seasoned_api/src/media_classes/movie.js deleted file mode 100644 index 98eb2ee..0000000 --- a/seasoned_api/src/media_classes/movie.js +++ /dev/null @@ -1,21 +0,0 @@ -class Movie { - constructor(title, year, type) { - this.id = undefined; - this.title = title; - this.year = year; - this.type = type; - this.release_date = undefined; - this.summary = undefined; - this.rating = undefined; - this.poster_path = undefined; - this.background = undefined; - this.genre = undefined; - this.date_added = undefined; - - this.mediaInfo = undefined; - - this.matchedInPlex = false; - } -} - -module.exports = Movie; diff --git a/seasoned_api/src/media_classes/show.js b/seasoned_api/src/media_classes/show.js deleted file mode 100644 index 5974ce6..0000000 --- a/seasoned_api/src/media_classes/show.js +++ /dev/null @@ -1,22 +0,0 @@ -class Movie { - constructor(title, year, type) { - this.id = undefined; - this.title = title; - this.year = year; - this.type = type; - this.release_date = undefined; - this.summary = undefined; - this.rating = undefined; - this.poster = undefined; - this.background = undefined; - this.genre = undefined; - this.added = undefined; - - this.seasons = undefined; - this.episodes = undefined; - - this.matchedInPlex = false; - } -} - -module.exports = Movie; \ No newline at end of file From 3ca3c068248c88c8800d71db9823773c2e7360bd Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 14:13:50 +0100 Subject: [PATCH 5/8] Removed static tag in tmdb functions. --- seasoned_api/src/tmdb/tmdb.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seasoned_api/src/tmdb/tmdb.js b/seasoned_api/src/tmdb/tmdb.js index 79b1e40..84ff91b 100644 --- a/seasoned_api/src/tmdb/tmdb.js +++ b/seasoned_api/src/tmdb/tmdb.js @@ -92,7 +92,7 @@ class TMDB { })); } - static tmdbMethod(apiMethod, type) { + tmdbMethod(apiMethod, type) { const method = TMDB_METHODS[apiMethod][type]; if (method !== undefined) return method; throw new Error('Could not find tmdb api method.'); @@ -104,7 +104,7 @@ class TMDB { * @param {type} The type declared in listSearch. * @returns {Promise} dict with tmdb results, mapped as movie/show objects. */ - static mapResults(response, type) { + mapResults(response, type) { return Promise.resolve() .then(() => { const mappedResults = response.results.map(result => convertTmdbToSeasoned(result, type)); From 98b10aa6935eaf08f7ea5184e893ce71a01ac9e7 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 14:15:10 +0100 Subject: [PATCH 6/8] Changed the api endpoint to one that requires to be logged in. --- .../system/asAUserIWantAForbiddenErrorIfTheTokenIsMalformed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seasoned_api/test/system/asAUserIWantAForbiddenErrorIfTheTokenIsMalformed.js b/seasoned_api/test/system/asAUserIWantAForbiddenErrorIfTheTokenIsMalformed.js index 73811b2..df637bd 100644 --- a/seasoned_api/test/system/asAUserIWantAForbiddenErrorIfTheTokenIsMalformed.js +++ b/seasoned_api/test/system/asAUserIWantAForbiddenErrorIfTheTokenIsMalformed.js @@ -8,7 +8,7 @@ describe('As a user I want a forbidden error if the token is malformed', () => { it('should return 401', () => request(app) - .get('/api/v1/plex/requests/all') + .get('/api/v1/pirate/search?query=test') .set('Authorization', 'maLfOrMed TOKEN') .expect(401) .then(response => assert.equal(response.body.error, 'You must be logged in.')) From b037cb23a2f64964e9ee2dd70faeb20ef74be045 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 14:16:45 +0100 Subject: [PATCH 7/8] Updated test to reflect new tmdb response. --- .../popular-movies-success-response.json | 376 +----------------- 1 file changed, 1 insertion(+), 375 deletions(-) diff --git a/seasoned_api/test/fixtures/popular-movies-success-response.json b/seasoned_api/test/fixtures/popular-movies-success-response.json index 3a906d4..30b8e5c 100644 --- a/seasoned_api/test/fixtures/popular-movies-success-response.json +++ b/seasoned_api/test/fixtures/popular-movies-success-response.json @@ -1,375 +1 @@ -{ - "page": 1, - "results": [ - { - "background": "/tcheoA2nPATCm2vvXw2hVQoaEFD.jpg", - "genre": [ - 18, - 14, - 27, - 53 - ], - "id": 346364, - "matchedInPlex": false, - "popularity": 847.49142, - "poster": "/9E2y5Q7WlCVNEhP5GiVTjhEhx1o.jpg", - "rating": 7.2, - "summary": "In a small town in Maine, seven children known as The Losers Club come face to face with life problems, bullies and a monster that takes the shape of a clown called Pennywise.", - "title": "It", - "type": "movie", - "vote_count": 4647, - "year": 2017 - }, - { - "background": "/askg3SMvhqEl4OL52YuvdtY40Yb.jpg", - "genre": [ - 12, - 16, - 10751 - ], - "id": 354912, - "matchedInPlex": false, - "popularity": 545.354595, - "poster": "/eKi8dIrr8voobbaGzDpe8w0PVbC.jpg", - "rating": 7.5, - "summary": "Despite his family’s baffling generations-old ban on music, Miguel dreams of becoming an accomplished musician like his idol, Ernesto de la Cruz. Desperate to prove his talent, Miguel finds himself in the stunning and colorful Land of the Dead following a mysterious chain of events. Along the way, he meets charming trickster Hector, and together, they set off on an extraordinary journey to unlock the real story behind Miguel's family history.", - "title": "Coco", - "type": "movie", - "vote_count": 532, - "year": 2017 - }, - { - "background": "/5Iw7zQTHVRBOYpA0V6z0yypOPZh.jpg", - "genre": [ - 28, - 12, - 14, - 878 - ], - "id": 181808, - "matchedInPlex": false, - "popularity": 510.708216, - "poster": "/xGWVjewoXnJhvxKW619cMzppJDQ.jpg", - "rating": 7.5, - "summary": "Rey develops her newly discovered abilities with the guidance of Luke Skywalker, who is unsettled by the strength of her powers. Meanwhile, the Resistance prepares to do battle with the First Order.", - "title": "Star Wars: The Last Jedi", - "type": "movie", - "vote_count": 1054, - "year": 2017 - }, - { - "background": "/o5T8rZxoWSBMYwjsUFUqTt6uMQB.jpg", - "genre": [ - 28, - 12, - 14, - 878 - ], - "id": 141052, - "matchedInPlex": false, - "popularity": 423.487801, - "poster": "/9rtrRGeRnL0JKtu9IMBWsmlmmZz.jpg", - "rating": 6.6, - "summary": "Fueled by his restored faith in humanity and inspired by Superman's selfless act, Bruce Wayne and Diana Prince assemble a team of metahumans consisting of Barry Allen, Arthur Curry, and Victor Stone to face the catastrophic threat of Steppenwolf and the Parademons who are on the hunt for three Mother Boxes on Earth.", - "title": "Justice League", - "type": "movie", - "vote_count": 1805, - "year": 2017 - }, - { - "background": "/52lVqTDhIeNTjT7EiJuovXgw6iE.jpg", - "genre": [ - 12, - 14, - 10751 - ], - "id": 8844, - "matchedInPlex": false, - "popularity": 372.129434, - "poster": "/8wBKXZNod4frLZjAKSDuAcQ2dEU.jpg", - "rating": 6.9, - "summary": "When siblings Judy and Peter discover an enchanted board game that opens the door to a magical world, they unwittingly invite Alan -- an adult who's been trapped inside the game for 26 years -- into their living room. Alan's only hope for freedom is to finish the game, which proves risky as all three find themselves running from giant rhinoceroses, evil monkeys and other terrifying creatures.", - "title": "Jumanji", - "type": "movie", - "vote_count": 2907, - "year": 1995 - }, - { - "background": "/qLmdjn2fv0FV2Mh4NBzMArdA0Uu.jpg", - "genre": [ - 10751, - 16, - 12, - 35 - ], - "id": 211672, - "matchedInPlex": false, - "popularity": 345.173187, - "poster": "/q0R4crx2SehcEEQEkYObktdeFy.jpg", - "rating": 6.4, - "summary": "Minions Stuart, Kevin and Bob are recruited by Scarlet Overkill, a super-villain who, alongside her inventor husband Herb, hatches a plot to take over the world.", - "title": "Minions", - "type": "movie", - "vote_count": 5237, - "year": 2015 - }, - { - "background": "/6aUWe0GSl69wMTSWWexsorMIvwU.jpg", - "genre": [ - 10751, - 14, - 10749 - ], - "id": 321612, - "matchedInPlex": false, - "popularity": 297.124109, - "poster": "/tWqifoYuwLETmmasnGHO7xBjEtt.jpg", - "rating": 6.8, - "summary": "A live-action adaptation of Disney's version of the classic tale of a cursed prince and a beautiful young woman who helps him break the spell.", - "title": "Beauty and the Beast", - "type": "movie", - "vote_count": 6318, - "year": 2017 - }, - { - "background": "/lMDyuHzBhx3zNAv48vYzmgcJCCD.jpg", - "genre": [ - 18, - 35 - ], - "id": 419680, - "matchedInPlex": false, - "popularity": 278.025258, - "poster": "/rF2IoKL0IFmumEXQFUuB8LajTYP.jpg", - "rating": 5.7, - "summary": "Brad and Dusty must deal with their intrusive fathers during the holidays.", - "title": "Daddy's Home 2", - "type": "movie", - "vote_count": 408, - "year": 2017 - }, - { - "background": "/tvKcA4OFUiZkNeTJmmTkNqKHMMg.jpg", - "genre": [ - 80, - 18, - 9648 - ], - "id": 392044, - "matchedInPlex": false, - "popularity": 259.276687, - "poster": "/iBlfxlw8qwtUS0R8YjIU7JtM6LM.jpg", - "rating": 6.8, - "summary": "Genius Belgian detective Hercule Poirot investigates the murder of an American tycoon aboard the Orient Express train.", - "title": "Murder on the Orient Express", - "type": "movie", - "vote_count": 878, - "year": 2017 - }, - { - "background": "/ulMscezy9YX0bhknvJbZoUgQxO5.jpg", - "genre": [ - 18, - 878, - 10752 - ], - "id": 281338, - "matchedInPlex": false, - "popularity": 252.304349, - "poster": "/3vYhLLxrTtZLysXtIWktmd57Snv.jpg", - "rating": 6.7, - "summary": "Caesar and his apes are forced into a deadly conflict with an army of humans led by a ruthless Colonel. After the apes suffer unimaginable losses, Caesar wrestles with his darker instincts and begins his own mythic quest to avenge his kind. As the journey finally brings them face to face, Caesar and the Colonel are pitted against each other in an epic battle that will determine the fate of both their species and the future of the planet.", - "title": "War for the Planet of the Apes", - "type": "movie", - "vote_count": 2692, - "year": 2017 - }, - { - "background": "/rz3TAyd5kmiJmozp3GUbYeB5Kep.jpg", - "genre": [ - 28, - 12, - 35, - 10751 - ], - "id": 353486, - "matchedInPlex": false, - "popularity": 250.35028, - "poster": "/bXrZ5iHBEjH7WMidbUDQ0U2xbmr.jpg", - "rating": 5.6, - "summary": "The tables are turned as four teenagers are sucked into Jumanji's world - pitted against rhinos, black mambas and an endless variety of jungle traps and puzzles. To survive, they'll play as characters from the game.", - "title": "Jumanji: Welcome to the Jungle", - "type": "movie", - "vote_count": 128, - "year": 2017 - }, - { - "background": "/iJ5dkwIHQnq8dfmwSLh7dpETNhi.jpg", - "genre": [ - 35, - 16, - 12 - ], - "id": 355547, - "matchedInPlex": false, - "popularity": 250.28269, - "poster": "/zms2RpkqjAtCsbjndTG9gAGWvnx.jpg", - "rating": 4.6, - "summary": "A small but brave donkey and his animal friends become the unsung heroes of the greatest story ever told, the first Christmas.", - "title": "The Star", - "type": "movie", - "vote_count": 78, - "year": 2017 - }, - { - "background": "/2SEgJ0mHJ7TSdVDbkGU061tR33K.jpg", - "genre": [ - 18, - 53, - 28, - 878 - ], - "id": 347882, - "matchedInPlex": false, - "popularity": 210.896389, - "poster": "/wridRvGxDqGldhzAIh3IcZhHT5F.jpg", - "rating": 5.4, - "summary": "A young street magician is left to take care of his little sister after his mother's passing and turns to drug dealing in the Los Angeles party scene to keep a roof over their heads. When he gets into trouble with his supplier, his sister is kidnapped and he is forced to rely on both his sleight of hand and brilliant mind to save her.", - "title": "Sleight", - "type": "movie", - "vote_count": 156, - "year": 2017 - }, - { - "background": "/5wNUJs23rT5rTBacNyf5h83AynM.jpg", - "genre": [ - 28, - 12, - 35, - 14, - 878 - ], - "id": 284053, - "matchedInPlex": false, - "popularity": 210.575092, - "poster": "/oSLd5GYGsiGgzDPKTwQh7wamO8t.jpg", - "rating": 7.5, - "summary": "Thor is imprisoned on the other side of the universe and finds himself in a race against time to get back to Asgard to stop Ragnarok, the prophecy of destruction to his homeworld and the end of Asgardian civilization, at the hands of an all-powerful new threat, the ruthless Hela.", - "title": "Thor: Ragnarok", - "type": "movie", - "vote_count": 2598, - "year": 2017 - }, - { - "background": "/uExPmkOHJySrbJyJDJylHDqaT58.jpg", - "genre": [ - 28, - 12, - 35 - ], - "id": 343668, - "matchedInPlex": false, - "popularity": 190.179283, - "poster": "/34xBL6BXNYFqtHO9zhcgoakS4aP.jpg", - "rating": 7.1, - "summary": "When an attack on the Kingsman headquarters takes place and a new villain rises, Eggsy and Merlin are forced to work together with the American agency known as the Statesman to save the world.", - "title": "Kingsman: The Golden Circle", - "type": "movie", - "vote_count": 1714, - "year": 2017 - }, - { - "background": "/bAI7aPHQcvSZXvt7L11kMJdS0Gm.jpg", - "genre": [ - 18, - 35, - 36 - ], - "id": 371638, - "matchedInPlex": false, - "popularity": 187.757689, - "poster": "/uCH6FOFsDW6pfvbbmIIswuvuNtM.jpg", - "rating": 7.2, - "summary": "An aspiring actor in Hollywood meets an enigmatic stranger by the name of Tommy Wiseau, the meeting leads the actor down a path nobody could have predicted; creating the worst movie ever made.", - "title": "The Disaster Artist", - "type": "movie", - "vote_count": 87, - "year": 2017 - }, - { - "background": "/2BXd0t9JdVqCp9sKf6kzMkr7QjB.jpg", - "genre": [ - 12, - 10751, - 16, - 28, - 35 - ], - "id": 177572, - "matchedInPlex": false, - "popularity": 180.209866, - "poster": "/9gLu47Zw5ertuFTZaxXOvNfy78T.jpg", - "rating": 7.7, - "summary": "The special bond that develops between plus-sized inflatable robot Baymax, and prodigy Hiro Hamada, who team up with a group of friends to form a band of high-tech heroes.", - "title": "Big Hero 6", - "type": "movie", - "vote_count": 6872, - "year": 2014 - }, - { - "background": "/6iUNJZymJBMXXriQyFZfLAKnjO6.jpg", - "genre": [ - 28, - 12, - 14 - ], - "id": 297762, - "matchedInPlex": false, - "popularity": 176.828995, - "poster": "/imekS7f1OuHyUP2LAiTEM0zBzUz.jpg", - "rating": 7.2, - "summary": "An Amazon princess comes to the world of Man to become the greatest of the female superheroes.", - "title": "Wonder Woman", - "type": "movie", - "vote_count": 6535, - "year": 2017 - }, - { - "background": "/umC04Cozevu8nn3JTDJ1pc7PVTn.jpg", - "genre": [ - 28, - 53 - ], - "id": 245891, - "matchedInPlex": false, - "popularity": 171.364116, - "poster": "/5vHssUeVe25bMrof1HyaPyWgaP.jpg", - "rating": 7, - "summary": "Ex-hitman John Wick comes out of retirement to track down the gangsters that took everything from him.", - "title": "John Wick", - "type": "movie", - "vote_count": 6117, - "year": 2014 - }, - { - "background": "/vc8bCGjdVp0UbMNLzHnHSLRbBWQ.jpg", - "genre": [ - 28, - 12, - 35, - 878 - ], - "id": 315635, - "matchedInPlex": false, - "popularity": 157.789584, - "poster": "/ApYhuwBWzl29Oxe9JJsgL7qILbD.jpg", - "rating": 7.3, - "summary": "Following the events of Captain America: Civil War, Peter Parker, with the help of his mentor Tony Stark, tries to balance his life as an ordinary high school student in Queens, New York City, with fighting crime as his superhero alter ego Spider-Man as a new threat, the Vulture, emerges.", - "title": "Spider-Man: Homecoming", - "type": "movie", - "vote_count": 5218, - "year": 2017 - } - ], - "total_pages": 992 -} \ No newline at end of file +{"results":[{"title":"The Maze Runner","year":2014,"type":"movie","id":198663,"summary":"Set in a post-apocalyptic world, young Thomas is deposited in a community of boys after his memory is erased, soon learning they're all trapped in a maze that will require him to join forces with fellow “runners” for a shot at escape.","poster_path":"/coss7RgL0NH6g4fC2s5atvf3dFO.jpg","background_path":"/lkOZcsXcOLZYeJ2YxJd3vSldvU4.jpg","popularity":435.990884,"score":7},{"title":"Blade Runner 2049","year":2017,"type":"movie","id":335984,"summary":"Thirty years after the events of the first film, a new blade runner, LAPD Officer K, unearths a long-buried secret that has the potential to plunge what's left of society into chaos. K's discovery leads him on a quest to find Rick Deckard, a former LAPD blade runner who has been missing for 30 years.","poster_path":"/gajva2L0rPYkEWjzgFlBXCAVBE5.jpg","background_path":"/mVr0UiqyltcfqxbAUcLl9zWL8ah.jpg","popularity":375.70732,"score":7.4},{"title":"Coco","year":2017,"type":"movie","id":354912,"summary":"Despite his family’s baffling generations-old ban on music, Miguel dreams of becoming an accomplished musician like his idol, Ernesto de la Cruz. Desperate to prove his talent, Miguel finds himself in the stunning and colorful Land of the Dead following a mysterious chain of events. Along the way, he meets charming trickster Hector, and together, they set off on an extraordinary journey to unlock the real story behind Miguel's family history.","poster_path":"/eKi8dIrr8voobbaGzDpe8w0PVbC.jpg","background_path":"/askg3SMvhqEl4OL52YuvdtY40Yb.jpg","popularity":373.720653,"score":7.7},{"title":"It","year":2017,"type":"movie","id":346364,"summary":"In a small town in Maine, seven children known as The Losers Club come face to face with life problems, bullies and a monster that takes the shape of a clown called Pennywise.","poster_path":"/9E2y5Q7WlCVNEhP5GiVTjhEhx1o.jpg","background_path":"/tcheoA2nPATCm2vvXw2hVQoaEFD.jpg","popularity":372.536196,"score":7.1},{"title":"Jumanji","year":1995,"type":"movie","id":8844,"summary":"When siblings Judy and Peter discover an enchanted board game that opens the door to a magical world, they unwittingly invite Alan -- an adult who's been trapped inside the game for 26 years -- into their living room. Alan's only hope for freedom is to finish the game, which proves risky as all three find themselves running from giant rhinoceroses, evil monkeys and other terrifying creatures.","poster_path":"/8wBKXZNod4frLZjAKSDuAcQ2dEU.jpg","background_path":"/7k4zEgUZbzMHawDaMc9yIkmY1qR.jpg","popularity":328.104005,"score":7},{"title":"Sleight","year":2017,"type":"movie","id":347882,"summary":"A young street magician is left to take care of his little sister after his mother's passing and turns to drug dealing in the Los Angeles party scene to keep a roof over their heads. When he gets into trouble with his supplier, his sister is kidnapped and he is forced to rely on both his sleight of hand and brilliant mind to save her.","poster_path":"/wridRvGxDqGldhzAIh3IcZhHT5F.jpg","background_path":"/2SEgJ0mHJ7TSdVDbkGU061tR33K.jpg","popularity":313.194105,"score":5.2},{"title":"Thor: Ragnarok","year":2017,"type":"movie","id":284053,"summary":"Thor is imprisoned on the other side of the universe and finds himself in a race against time to get back to Asgard to stop Ragnarok, the prophecy of destruction to his homeworld and the end of Asgardian civilization, at the hands of an all-powerful new threat, the ruthless Hela.","poster_path":"/oSLd5GYGsiGgzDPKTwQh7wamO8t.jpg","background_path":"/kaIfm5ryEOwYg8mLbq8HkPuM1Fo.jpg","popularity":275.821051,"score":7.5},{"title":"War for the Planet of the Apes","year":2017,"type":"movie","id":281338,"summary":"Caesar and his apes are forced into a deadly conflict with an army of humans led by a ruthless Colonel. After the apes suffer unimaginable losses, Caesar wrestles with his darker instincts and begins his own mythic quest to avenge his kind. As the journey finally brings them face to face, Caesar and the Colonel are pitted against each other in an epic battle that will determine the fate of both their species and the future of the planet.","poster_path":"/3vYhLLxrTtZLysXtIWktmd57Snv.jpg","background_path":"/ulMscezy9YX0bhknvJbZoUgQxO5.jpg","popularity":256.86709,"score":6.8},{"title":"Olaf's Frozen Adventure","year":2017,"type":"movie","id":460793,"summary":"Olaf is on a mission to harness the best holiday traditions for Anna, Elsa, and Kristoff.","poster_path":"/47pLZ1gr63WaciDfHCpmoiXJlVr.jpg","background_path":"/9K4QqQZg4TVXcxBGDiVY4Aey3Rn.jpg","popularity":255.47965,"score":5.9},{"title":"Minions","year":2015,"type":"movie","id":211672,"summary":"Minions Stuart, Kevin and Bob are recruited by Scarlet Overkill, a super-villain who, alongside her inventor husband Herb, hatches a plot to take over the world.","poster_path":"/q0R4crx2SehcEEQEkYObktdeFy.jpg","background_path":"/qLmdjn2fv0FV2Mh4NBzMArdA0Uu.jpg","popularity":211.499685,"score":6.4},{"title":"Baby Driver","year":2017,"type":"movie","id":339403,"summary":"After being coerced into working for a crime boss, a young getaway driver finds himself taking part in a heist doomed to fail.","poster_path":"/dN9LbVNNZFITwfaRjl4tmwGWkRg.jpg","background_path":"/goCvLSUFz0p7k8R10Hv4CVh3EQv.jpg","popularity":208.126298,"score":7.3},{"title":"Batman v Superman: Dawn of Justice","year":2016,"type":"movie","id":209112,"summary":"Fearing the actions of a god-like Super Hero left unchecked, Gotham City’s own formidable, forceful vigilante takes on Metropolis’s most revered, modern-day savior, while the world wrestles with what sort of hero it really needs. And with Batman and Superman at war with one another, a new threat quickly arises, putting mankind in greater danger than it’s ever known before.","poster_path":"/cGOPbv9wA5gEejkUN892JrveARt.jpg","background_path":"/vsjBeMPZtyB7yNsYY56XYxifaQZ.jpg","popularity":186.4518,"score":5.7},{"title":"Pirates of the Caribbean: Dead Men Tell No Tales","year":2017,"type":"movie","id":166426,"summary":"Thrust into an all-new adventure, a down-on-his-luck Capt. Jack Sparrow feels the winds of ill-fortune blowing even more strongly when deadly ghost sailors led by his old nemesis, the evil Capt. Salazar, escape from the Devil's Triangle. Jack's only hope of survival lies in seeking out the legendary Trident of Poseidon, but to find it, he must forge an uneasy alliance with a brilliant and beautiful astronomer and a headstrong young man in the British navy.","poster_path":"/xbpSDU3p7YUGlu9Mr6Egg2Vweto.jpg","background_path":"/7C921eWK06n12c1miRXnYoEu5Yv.jpg","popularity":177.161496,"score":6.5},{"title":"Valerian and the City of a Thousand Planets","year":2017,"type":"movie","id":339964,"summary":"In the 28th century, Valerian and Laureline are special operatives charged with keeping order throughout the human territories. On assignment from the Minister of Defense, the two undertake a mission to Alpha, an ever-expanding metropolis where species from across the universe have converged over centuries to share knowledge, intelligence, and cultures. At the center of Alpha is a mysterious dark force which threatens the peaceful existence of the City of a Thousand Planets, and Valerian and Laureline must race to identify the menace and safeguard not just Alpha, but the future of the universe.","poster_path":"/jfIpMh79fGRqYJ6PwZLCntzgxlF.jpg","background_path":"/7WjMTRF6LDa4latRUIDM25xnDO0.jpg","popularity":175.858459,"score":6.6},{"title":"John Wick","year":2014,"type":"movie","id":245891,"summary":"Ex-hitman John Wick comes out of retirement to track down the gangsters that took everything from him.","poster_path":"/5vHssUeVe25bMrof1HyaPyWgaP.jpg","background_path":"/umC04Cozevu8nn3JTDJ1pc7PVTn.jpg","popularity":171.559878,"score":7},{"title":"Geostorm","year":2017,"type":"movie","id":274855,"summary":"After an unprecedented series of natural disasters threatened the planet, the world's leaders came together to create an intricate network of satellites to control the global climate and keep everyone safe. But now, something has gone wrong: the system built to protect Earth is attacking it, and it becomes a race against the clock to uncover the real threat before a worldwide geostorm wipes out everything and everyone along with it.","poster_path":"/nrsx0jEaBgXq4PWo7SooSnYJTv.jpg","background_path":"/6jrMdMe4sMygTcJPpQTjKPmP4l0.jpg","popularity":159.899247,"score":5.7},{"title":"Beauty and the Beast","year":2017,"type":"movie","id":321612,"summary":"A live-action adaptation of Disney's version of the classic tale of a cursed prince and a beautiful young woman who helps him break the spell.","poster_path":"/tWqifoYuwLETmmasnGHO7xBjEtt.jpg","background_path":"/6aUWe0GSl69wMTSWWexsorMIvwU.jpg","popularity":156.774587,"score":6.8},{"title":"The Hunger Games: Mockingjay - Part 1","year":2014,"type":"movie","id":131631,"summary":"Katniss Everdeen reluctantly becomes the symbol of a mass rebellion against the autocratic Capitol.","poster_path":"/gj282Pniaa78ZJfbaixyLXnXEDI.jpg","background_path":"/4PwyB0ErucIANzW24Kori71J6gU.jpg","popularity":148.551513,"score":6.7},{"title":"Star Wars: The Last Jedi","year":2017,"type":"movie","id":181808,"summary":"Rey develops her newly discovered abilities with the guidance of Luke Skywalker, who is unsettled by the strength of her powers. Meanwhile, the Resistance prepares to do battle with the First Order.","poster_path":"/kOVEVeg59E0wsnXmF9nrh6OmWII.jpg","background_path":"/5Iw7zQTHVRBOYpA0V6z0yypOPZh.jpg","popularity":144.320581,"score":7.2},{"title":"John Wick: Chapter 2","year":2017,"type":"movie","id":324552,"summary":"John Wick is forced out of retirement by a former associate looking to seize control of a shadowy international assassins’ guild. Bound by a blood oath to aid him, Wick travels to Rome and does battle against some of the world’s most dangerous killers.","poster_path":"/zkXnKIwX5pYorKJp2fjFSfNyKT0.jpg","background_path":"/dQ6s3Ud2KoOs3LKw6xgZr1cw7Yq.jpg","popularity":137.808961,"score":6.8}],"page":1,"total_pages":988,"total_results":19757} \ No newline at end of file From 30b494e3565cb480dd1e27224def19d0d2972075 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 7 Feb 2018 14:20:34 +0100 Subject: [PATCH 8/8] The id used for searching was somehow not a movies id and returned false. --- seasoned_api/test/system/asAUserIWantToRequestAMovie.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seasoned_api/test/system/asAUserIWantToRequestAMovie.js b/seasoned_api/test/system/asAUserIWantToRequestAMovie.js index fda5f0a..f51c085 100644 --- a/seasoned_api/test/system/asAUserIWantToRequestAMovie.js +++ b/seasoned_api/test/system/asAUserIWantToRequestAMovie.js @@ -10,7 +10,7 @@ describe('As a user I want to request a movie', () => { it('should return 200 when item is requested', () => request(app) - .post('/api/v1/plex/request/31749') + .post('/api/v1/plex/request/329865') .set('Authorization', createToken('test_user', 'secret')) .expect(200) );