8.0.1 • Published 4 years ago

trakt.tv-ondeck v8.0.1

Weekly downloads
307
License
MIT
Repository
github
Last release
4 years ago

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.

1) Install:

npm install trakt.tv trakt.tv-ondeck

2) Load the plugin:

const Trakt = require('trakt.tv');
let trakt = new Trakt({
    client_id: '',
    client_secret: '',
    plugins: {
        ondeck: require('trakt.tv-ondeck')
    }
});

3) Log in with trakt.tv, then call "ondeck":

let onDeckToWatch = {};
trakt.ondeck.getAll().then(function (results) {
    onDeckToWatch = results;
    console.log(onDeckToWatch);
});

Note: you can bypass the builtin trakt.sync.watched({type:'shows'}) by passing the resulting array as an argument, i.e. trakt.ondeck.getAll(watchedArray)

4) To avoid calling getAll() everytime, you can use updateOne() after an episode was seen:

// let's say we just watched Arrow 01x01 - Pilot that was on the 'on deck' propositions
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

8.0.1

4 years ago

8.0.0

4 years ago

7.0.0

5 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.1

7 years ago

5.0.0

7 years ago

0.1.1

7 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago