Skip to content

Commit

Permalink
fix: correct find implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 17, 2017
1 parent 627fefc commit c056e15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Tmdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Tmdb {
}

const result = await this.get('find/' + externalId, {
external_source: externalSource
external_source: externalSource + '_id'
});

if (result.movieResults.length === 0) {
Expand Down
6 changes: 3 additions & 3 deletions test/Tmdb/findId.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('finds TMDb movie record ID using IMDb ID', async (t) => {
const tmdb = new Tmdb(apiKey);

const scope = nock('https://api.themoviedb.org')
.get('/3/find/tt1?api_key=foo&external_source=imdb')
.get('/3/find/tt1?api_key=foo&external_source=imdb_id')
.reply(
200,
{
Expand All @@ -40,7 +40,7 @@ test('throws NotFoundError if resource cannot be found', async (t) => {
const tmdb = new Tmdb(apiKey);

const scope = nock('https://api.themoviedb.org')
.get('/3/find/tt1?api_key=foo&external_source=imdb')
.get('/3/find/tt1?api_key=foo&external_source=imdb_id')
.reply(
200,
{
Expand All @@ -63,7 +63,7 @@ test('throws UnexpectedResponseError if multiple results are returned', async (t
const tmdb = new Tmdb(apiKey);

const scope = nock('https://api.themoviedb.org')
.get('/3/find/tt1?api_key=foo&external_source=imdb')
.get('/3/find/tt1?api_key=foo&external_source=imdb_id')
.reply(
200,
{
Expand Down

0 comments on commit c056e15

Please sign in to comment.