Trakt.tv OnDeck
Extends https://github.com/vankasteelj/trakt.tv node module, in order to get the equivalent of "on deck to watch"
NOTICE: requires trakt.tv module! Load this plugin directly through trakt.tv
module.
- Install:
npm install trakt.tv trakt.tv-ondeck
- Load the plugin:
var Trakt = require('trakt.tv');
var trakt = new Trakt({
client_id: '',
client_secret: '',
plugins: {
ondeck: require('trakt.tv-ondeck')
}
});
- Log in with trakt.tv, then call "ondeck":
var onDeckToWatch;
trakt.ondeck.getAll().then(function (results) {
onDeckToWatch = results;
console.log(onDeckToWatch);
});
- To avoid calling getAll() everytime, you can use updateOne() after an episode was seen:
trakt.ondeck.updateOne(onDeckToWatch, 'arrow').then(function (updatedResults) {
onDeckToWatch = updatedResults;
console.log(updatedResults);
});
note: 'arrow' is the slug, you can also use an ID like imdb if you want. onDeckToWatch is the exact object you recieved from getAll()
License MIT, (c) vankasteelj