sungshon / PimpMyStremio

Local add-on manager for Stremio
MIT License
382 stars 52 forks source link

Add Stremio discord addon #39

Closed sleeyax closed 5 years ago

sleeyax commented 5 years ago

This addon will display the current movie or series as 'game activity' on Discord. It requires the discord-rpc package to be whitelisted though.

sungshon commented 5 years ago

I love the idea of this add-on, and even though discord-rpc would probably only ever be used for this one add-on, I'd still add it.

But there are a few things that we need to think about first.

So, with discord-rpc, the only way i can make sure it will work when the app is packaged, is by packaging and testing the add-on before releasing it. This only means it might take a bit longer before I can be sure there won't be issues so I can merge the PR.

Please set the "requires": "1.1.9" for ur add-on in the meanwhile.

sungshon commented 5 years ago

uhm, i see this also uses a module called imdb: https://github.com/sleeyax/stremio-discord/blob/master/package.json#L12

that is not in the whitelist, can u please change that code to use cinemeta's endpoint?

cinemeta is an internal module though, and i saw u want this add-on to work standalone too, so instead of using the internal module for it, you can just replicate the logic from this file:

https://github.com/sungshon/PimpMyStremio/blob/master/src/lib/cinemeta.js

It should be as easy as changing this line:

https://github.com/sleeyax/stremio-discord/blob/master/addon.js#L21

to: const info = await imdb(args);

and the request in imdb-promise.js should look something like:

needle.get('https://v3-cinemeta.strem.io/meta/' + args.type + '/' + args.id + '.json', (err, resp, body) => {
    if (body && body.meta) {
        resolve(body.meta)
    } else {
        reject(err || Error('Unknown error in cinemeta for request: ' + JSON.stringify(args)))
    }
})

it shouldn't be a hard change, and will help us not whitelist the imdb module for something we already have an internal solution for.

sungshon commented 5 years ago

I've created a PR that uses cinemeta: https://github.com/sleeyax/stremio-discord/pull/1

sungshon commented 5 years ago

If u merge that PR and make a new release on github, I'll merge the PR for PMS too.

I've had time to test it with the built app and it works well.

sleeyax commented 5 years ago

Good to hear that! I'll publish a release right away. Thanks again.

sungshon commented 5 years ago

merged! thank you for this fun add-on, I don't think anyone ever thought of using the subtitle handler like this before :))

i think this could of been a great add-on for the add-on contest, it's a fun and original idea

sungshon commented 5 years ago

I've published a new release that includes your add-on.