Actually search for a video with the exact same title
This commit is contained in:
parent
67beeca09d
commit
ef98bb2885
|
@ -29,11 +29,12 @@ const search = query => new Promise(async (resolve, reject) => {
|
|||
.then(function(data) {
|
||||
if (data.total > 0) {
|
||||
const video = data.data[0]
|
||||
resolve(video);
|
||||
} else {
|
||||
reject(new Error('No results.'))
|
||||
if (video.name === query) {
|
||||
resolve(video);
|
||||
}
|
||||
}
|
||||
})
|
||||
reject(new Error('No results.'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue