Remove unnecessary bluebird dependency

This commit is contained in:
Jonathan Cremin 2018-04-13 18:36:58 +01:00
parent b87476abc9
commit 42b6cd5a32
9 changed files with 10437 additions and 231 deletions

View file

@ -3,7 +3,6 @@ import querystring from 'querystring';
import request from 'superagent';
import Nodebrainz from 'nodebrainz';
import { toSeconds, parse as ptParse } from 'iso8601-duration';
import 'superagent-bluebird-promise';
import debuglog from 'debug';
import urlMatch from './url';
@ -30,7 +29,7 @@ const apiRoot = 'https://www.googleapis.com/youtube/v3';
export function* lookupId(id) {
const path = `/videos?part=snippet%2CcontentDetails&id=${id}&key=${credentials.key}`;
try {
const result = yield request.get(apiRoot + path).promise();
const result = yield request.get(apiRoot + path);
const item = result.body.items[0].snippet;
const duration = toSeconds(ptParse(result.body.items[0].contentDetails.duration));
@ -85,7 +84,7 @@ export function* search(data) {
}
const path = `/search?part=snippet&q=${encodeURIComponent(query)}&type=video&videoCaption=any&videoCategoryId=10&key=${credentials.key}`;
const result = yield request.get(apiRoot + path).promise();
const result = yield request.get(apiRoot + path);
const item = result.body.items[0];
if (!item) {