Register plex instance with token parameter for authenticated calls to plex (#144)
This commit is contained in:
@@ -97,8 +97,9 @@ function mapResults(response) {
|
||||
}
|
||||
|
||||
class Plex {
|
||||
constructor(ip, port = 32400, cache = null) {
|
||||
constructor(ip, token, port = 32400, cache = null) {
|
||||
this.plexIP = ip;
|
||||
this.token = token;
|
||||
this.plexPort = port;
|
||||
|
||||
this.cache = cache || redisCache;
|
||||
|
||||
@@ -4,7 +4,10 @@ import Configuration from "../../../config/configuration.js";
|
||||
|
||||
const configuration = Configuration.getInstance();
|
||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||
const plex = new Plex(configuration.get("plex", "ip"));
|
||||
const plex = new Plex(
|
||||
configuration.get("plex", "ip"),
|
||||
configuration.get("plex", "token")
|
||||
);
|
||||
|
||||
/**
|
||||
* Controller: Retrieve information for a movie
|
||||
|
||||
@@ -3,7 +3,10 @@ import Configuration from "../../../config/configuration.js";
|
||||
|
||||
const configuration = Configuration.getInstance();
|
||||
|
||||
const plex = new Plex(configuration.get("plex", "ip"));
|
||||
const plex = new Plex(
|
||||
configuration.get("plex", "ip"),
|
||||
configuration.get("plex", "token")
|
||||
);
|
||||
|
||||
/**
|
||||
* Controller: Search plex for movies, shows and episodes by query
|
||||
|
||||
@@ -2,7 +2,10 @@ import Plex from "../../../plex/plex.js";
|
||||
import Configuration from "../../../config/configuration.js";
|
||||
|
||||
const configuration = Configuration.getInstance();
|
||||
const plex = new Plex(configuration.get("plex", "ip"));
|
||||
const plex = new Plex(
|
||||
configuration.get("plex", "ip"),
|
||||
configuration.get("plex", "token")
|
||||
);
|
||||
|
||||
/**
|
||||
* Controller: Search plex for movies, shows and episodes by query
|
||||
|
||||
@@ -4,7 +4,10 @@ import Configuration from "../../../config/configuration.js";
|
||||
|
||||
const configuration = Configuration.getInstance();
|
||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||
const plex = new Plex(configuration.get("plex", "ip"));
|
||||
const plex = new Plex(
|
||||
configuration.get("plex", "ip"),
|
||||
configuration.get("plex", "token")
|
||||
);
|
||||
|
||||
/**
|
||||
* Controller: Retrieve information for a show
|
||||
|
||||
Reference in New Issue
Block a user