Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Fix for single movie search result with no exact name / year match (#144
Browse files Browse the repository at this point in the history
)
  • Loading branch information
smoothlystable authored Jun 20, 2020
1 parent 64be44e commit d88fd9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/class/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class Search {
url: this.getUrl(),
success: function (response) {
let data = JSON.parse(response);
if (_this.item && _this.item.type === `movie`) {
if (data.length > 1 && _this.item && _this.item.type === `movie`) {
// Get exact match if there are multiple movies with the same name by checking the year.
data = data.filter(item => item.movie.title === _this.item.title && item.movie.year === _this.item.year)[0];
} else {
Expand Down

0 comments on commit d88fd9a

Please sign in to comment.