Closed sleeyax closed 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.
The addonsList.json
now auto-updates to all users straight from the raw data of this github repo, as this add-on needs a new module added, we need to state in addonsList.json
that this add-on will only work from the next version of PMS, so please set "requires": "1.1.9"
for ur add-on in addonsList.json
to solve this
discord-rpc
has only 2 dependencies: node-fetch
and ws
. We can even add node-fetch
as a dep to this repo too and whitelist it as an alternative http fetcher. There might be a issue with ws
though.. Afaik, ws
's server implementation uses a binary (unless something changed), and discord-rpc
seems to install the entire thing, not just the client. This could or could not be an issue, i'm pretty sure they just need the client for this, so as long as the server isn't used, it shouldn't cry about it's missing binary.. (keep in mind, all binaries are lost when packaging the app, need to be added separately as assets, and i would generally avoid binary dependencies for better cross-platform support)
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.
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.
I've created a PR that uses cinemeta: https://github.com/sleeyax/stremio-discord/pull/1
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.
Good to hear that! I'll publish a release right away. Thanks again.
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
I've published a new release that includes your add-on.
This addon will display the current movie or series as 'game activity' on Discord. It requires the discord-rpc package to be whitelisted though.