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) {
|
.then(function(data) {
|
||||||
if (data.total > 0) {
|
if (data.total > 0) {
|
||||||
const video = data.data[0]
|
const video = data.data[0]
|
||||||
resolve(video);
|
if (video.name === query) {
|
||||||
} else {
|
resolve(video);
|
||||||
reject(new Error('No results.'))
|
}
|
||||||
}
|
}
|
||||||
})
|
reject(new Error('No results.'));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue