Skip to content

Commit

Permalink
Merge pull request oddnetworks#4 from oddnetworks/schedule
Browse files Browse the repository at this point in the history
Adds schedule checking
  • Loading branch information
blainsmith authored Nov 30, 2016
2 parents 06e04a9 + f64b296 commit 9d21a81
Show file tree
Hide file tree
Showing 9 changed files with 373 additions and 100 deletions.
6 changes: 3 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ REQUEST_METHODS.getAccessToken = '{}';
REQUEST_METHODS.getPlaylistCount = '{"query": "OBJECT"}';
REQUEST_METHODS.getPlaylists = '{"query": "OBJECT"}';
REQUEST_METHODS.getPlaylist = '{"playlistId": "STRING"}';
REQUEST_METHODS.getVideosByPlaylist = '{"playlistId": "STRING"}';
REQUEST_METHODS.getVideosByPlaylist = '{"playlistId": "STRING", "skipScheduleCheck": "BOOLEAN"}';
REQUEST_METHODS.getVideoCountByPlaylist = '{"playlistId": "STRING"}';
REQUEST_METHODS.getVideoCount = '{"query": "OBJECT"}';
REQUEST_METHODS.getVideos = '{"query": "OBJECT"}';
REQUEST_METHODS.getVideo = '{"videoId": "STRING"}';
REQUEST_METHODS.getVideos = '{"query": "OBJECT", "skipScheduleCheck": "BOOLEAN"}';
REQUEST_METHODS.getVideo = '{"videoId": "STRING", "skipScheduleCheck": "BOOLEAN"}';
REQUEST_METHODS.getVideoSources = '{"videoId": "STRING"}';

const listCommand = () => {
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const Promise = require('bluebird');
const debug = require('debug')('oddworks:provider:brightcove');
const Client = require('./lib/client');
const defaultVideoTransform = require('./lib/default-video-transform');
const defaultCollectionTransform = require('./lib/default-collection-transform');
Expand All @@ -20,6 +21,7 @@ const DEFAULTS = {
// options.collectionTransform
// options.videoTransform
exports.initialize = options => {
debug('initialize');
options = Object.assign({}, DEFAULTS, options || {});

const bus = options.bus;
Expand Down Expand Up @@ -57,6 +59,7 @@ exports.initialize = options => {
};

exports.createPlaylistHandler = (bus, getChannel, client, transform) => {
debug('createPlaylistHandler');
const getCollection = fetchBrightcovePlaylist(bus, client, transform);

// Called from Oddworks core via bus.query
Expand All @@ -83,6 +86,7 @@ exports.createPlaylistHandler = (bus, getChannel, client, transform) => {
};

exports.createVideoHandler = (bus, getChannel, client, transform) => {
debug('createVideoHandler');
const getVideo = fetchBrightcoveVideo(bus, client, transform);

// Called from Oddworks core via bus.query
Expand Down Expand Up @@ -111,6 +115,7 @@ exports.createVideoHandler = (bus, getChannel, client, transform) => {
// options.accountId *required
// options.bus *optional
exports.createClient = options => {
debug('createClient');
options = Object.assign({}, DEFAULTS, options || {});

const bus = options.bus;
Expand Down
Loading

0 comments on commit 9d21a81

Please sign in to comment.