Skip to content

Commit

Permalink
Add seriesid to episode. Fixes #72
Browse files Browse the repository at this point in the history
  • Loading branch information
worr committed Aug 1, 2020
1 parent fc2890a commit 986e78b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/imdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ export class Episode extends Movie {
/** what number episode in the season this episode is */
public episode: number;

/** what series this episode is a part of (imdbid) */
public seriesid: string;

/**
* Creates an epsiode from results from omdb. This is not intended for consumer use.
* Please prefer {@link TVShow.epsiodes}.
Expand Down
7 changes: 6 additions & 1 deletion test/test-getReq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ describe("get", () => {
"The Scorpion and the Toad",
"testing returned title"
);
assert.deepEqual(data.year, 2006, "testing correct year");
if (!(data instanceof imdb.Episode)) {
assert.fail("not an episode");
} else {
assert.equal(data.seriesid, "tt0460649", "testing seriesid");
assert.deepEqual(data.year, 2006, "testing correct year");
}
})
);
});
Expand Down

0 comments on commit 986e78b

Please sign in to comment.