diff --git a/index.js b/index.js index a2bb693..f92b975 100644 --- a/index.js +++ b/index.js @@ -67,8 +67,8 @@ exports.createPlaylistHandler = (bus, getChannel, client, transform) => { // args.spec.playlist.id return args => { const spec = args.spec; - const playlist = spec.playlist || {}; - const playlistId = playlist.id; + const collection = spec.playlist || {}; + const playlistId = collection.id; const channelId = spec.channel; if (!playlistId || typeof playlistId !== 'string') { @@ -77,8 +77,6 @@ exports.createPlaylistHandler = (bus, getChannel, client, transform) => { ); } - const collection = args.object; - return getChannel(channelId).then(channel => { return getCollection({spec, channel, collection, playlistId}); }); diff --git a/lib/fetch-brightcove-video.js b/lib/fetch-brightcove-video.js index b2817cf..001bcef 100644 --- a/lib/fetch-brightcove-video.js +++ b/lib/fetch-brightcove-video.js @@ -6,7 +6,6 @@ const debug = require('debug')('oddworks:provider:brightcove:fetch-brightcove-vi module.exports = (bus, client, transform) => { return args => { - debug('fetchBrightcoveVideo'); const channel = args.channel; const secrets = channel.secrets || {}; const spec = args.spec; @@ -27,6 +26,8 @@ module.exports = (bus, client, transform) => { creds.accountId = secrets.brightcove.accountId; } + debug(`fetchBrightcoveVideo id: ${videoId}`); + const params = Object.assign({videoId, skipScheduleCheck}, creds); return client.getVideo(params) .then(video => {