Socket
Socket
Sign inDemoInstall

trakt.tv-ondeck

Package Overview
Dependencies
31
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    trakt.tv-ondeck

Plugin for adding 'ondeck' to trakt.tv module


Version published
Weekly downloads
425
decreased by-2.52%
Maintainers
1
Install size
4.52 MB
Created
Weekly downloads
 

Readme

Source

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

  1. Load the plugin:
const Trakt = require('trakt.tv');
let trakt = new Trakt({
    client_id: '',
    client_secret: '',
    plugins: {
        ondeck: require('trakt.tv-ondeck')
    }
});
  1. 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)

  1. 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

Keywords

FAQs

Last updated on 15 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc