mirror of
https://github.com/LukeHagar/plex-api-oauth.git
synced 2025-12-06 12:37:50 +00:00
Moving to all stateless
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plex-api-oauth",
|
"name": "plex-api-oauth",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
|
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ export class PlexAPIOAuth {
|
|||||||
plexTVUserData;
|
plexTVUserData;
|
||||||
plexServers;
|
plexServers;
|
||||||
plexLibraries;
|
plexLibraries;
|
||||||
plexArtistLibraries;
|
|
||||||
plexAlbumLibraries;
|
|
||||||
plexSongLibraries;
|
|
||||||
plexMusicLibraries;
|
|
||||||
plexMovieLibraries;
|
|
||||||
plexTVShowLibraries;
|
|
||||||
plexDevices;
|
plexDevices;
|
||||||
constructor(
|
constructor(
|
||||||
clientId = "",
|
clientId = "",
|
||||||
@@ -33,15 +27,6 @@ export class PlexAPIOAuth {
|
|||||||
plexTVUserData = {},
|
plexTVUserData = {},
|
||||||
plexServers = [],
|
plexServers = [],
|
||||||
plexLibraries = [],
|
plexLibraries = [],
|
||||||
plexArtistLibraries = [],
|
|
||||||
plexAlbumLibraries = [],
|
|
||||||
plexSongLibraries = [],
|
|
||||||
plexMusicLibraries = [],
|
|
||||||
plexMovieLibraries = [],
|
|
||||||
plexTVShowLibraries = [],
|
|
||||||
plexLibraryContent = [],
|
|
||||||
plexMovieLibraryContent = [],
|
|
||||||
plexTVShowLibraryContent = [],
|
|
||||||
plexDevices = []
|
plexDevices = []
|
||||||
) {
|
) {
|
||||||
this.clientId = clientId;
|
this.clientId = clientId;
|
||||||
@@ -53,17 +38,8 @@ export class PlexAPIOAuth {
|
|||||||
this.plexTVAuthToken = plexTVAuthToken;
|
this.plexTVAuthToken = plexTVAuthToken;
|
||||||
this.plexTVUserData = plexTVUserData;
|
this.plexTVUserData = plexTVUserData;
|
||||||
this.plexServers = plexServers;
|
this.plexServers = plexServers;
|
||||||
this.plexLibraries = plexLibraries;
|
|
||||||
this.plexArtistLibraries = plexArtistLibraries;
|
|
||||||
this.plexAlbumLibraries = plexAlbumLibraries;
|
|
||||||
this.plexSongLibraries = plexSongLibraries;
|
|
||||||
this.plexMusicLibraries = plexMusicLibraries;
|
|
||||||
this.plexMovieLibraries = plexMovieLibraries;
|
|
||||||
this.plexTVShowLibraries = plexTVShowLibraries;
|
|
||||||
this.plexLibraryContent = plexLibraryContent;
|
|
||||||
this.plexMovieLibraryContent = plexMovieLibraryContent;
|
|
||||||
this.plexTVShowLibraryContent = plexTVShowLibraryContent;
|
|
||||||
this.plexDevices = plexDevices;
|
this.plexDevices = plexDevices;
|
||||||
|
this.plexLibraries = plexLibraries;
|
||||||
|
|
||||||
this.plexClientInformation = {
|
this.plexClientInformation = {
|
||||||
clientIdentifier: this.clientId, // This is a unique identifier used to identify your app with Plex. - If none is provided a new one is generated and saved locally
|
clientIdentifier: this.clientId, // This is a unique identifier used to identify your app with Plex. - If none is provided a new one is generated and saved locally
|
||||||
@@ -86,15 +62,6 @@ export class PlexAPIOAuth {
|
|||||||
this.plexTVUserData = {};
|
this.plexTVUserData = {};
|
||||||
this.plexServers = [];
|
this.plexServers = [];
|
||||||
this.plexLibraries = [];
|
this.plexLibraries = [];
|
||||||
this.plexArtistLibraries = [];
|
|
||||||
this.plexAlbumLibraries = [];
|
|
||||||
this.plexSongLibraries = [];
|
|
||||||
this.plexMusicLibraries = [];
|
|
||||||
this.plexMovieLibraries = [];
|
|
||||||
this.plexTVShowLibraries = [];
|
|
||||||
this.plexLibraryContent = [];
|
|
||||||
this.plexMovieLibraryContent = [];
|
|
||||||
this.plexTVShowLibraryContent = [];
|
|
||||||
this.plexDevices = [];
|
this.plexDevices = [];
|
||||||
this.plexClientInformation = {
|
this.plexClientInformation = {
|
||||||
clientIdentifier: this.clientId, // This is a unique identifier used to identify your app with Plex. - If none is provided a new one is generated and saved locally
|
clientIdentifier: this.clientId, // This is a unique identifier used to identify your app with Plex. - If none is provided a new one is generated and saved locally
|
||||||
@@ -116,17 +83,9 @@ export class PlexAPIOAuth {
|
|||||||
plexTVAuthToken = "",
|
plexTVAuthToken = "",
|
||||||
plexTVUserData = {},
|
plexTVUserData = {},
|
||||||
plexServers = [],
|
plexServers = [],
|
||||||
|
plexDevices = [],
|
||||||
plexLibraries = [],
|
plexLibraries = [],
|
||||||
plexLibraryContent = [],
|
plexLibraryContent = [],
|
||||||
plexArtistLibraries = [],
|
|
||||||
plexAlbumLibraries = [],
|
|
||||||
plexSongLibraries = [],
|
|
||||||
plexMusicLibraries = [],
|
|
||||||
plexMovieLibraries = [],
|
|
||||||
plexTVShowLibraries = [],
|
|
||||||
plexMovieLibraryContent = [],
|
|
||||||
plexTVShowLibraryContent = [],
|
|
||||||
plexDevices = [],
|
|
||||||
}) {
|
}) {
|
||||||
this.plexTVAuthToken = plexTVAuthToken;
|
this.plexTVAuthToken = plexTVAuthToken;
|
||||||
this.plexTVUserData = plexTVUserData;
|
this.plexTVUserData = plexTVUserData;
|
||||||
@@ -137,17 +96,8 @@ export class PlexAPIOAuth {
|
|||||||
this.forwardUrl = forwardUrl;
|
this.forwardUrl = forwardUrl;
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
this.plexServers = plexServers;
|
this.plexServers = plexServers;
|
||||||
this.plexLibraries = plexLibraries;
|
|
||||||
this.plexArtistLibraries = plexArtistLibraries;
|
|
||||||
this.plexAlbumLibraries = plexAlbumLibraries;
|
|
||||||
this.plexSongLibraries = plexSongLibraries;
|
|
||||||
this.plexMusicLibraries = plexMusicLibraries;
|
|
||||||
this.plexMovieLibraries = plexMovieLibraries;
|
|
||||||
this.plexTVShowLibraries = plexTVShowLibraries;
|
|
||||||
this.plexLibraryContent = plexLibraryContent;
|
|
||||||
this.plexMovieLibraryContent = plexMovieLibraryContent;
|
|
||||||
this.plexTVShowLibraryContent = plexTVShowLibraryContent;
|
|
||||||
this.plexDevices = plexDevices;
|
this.plexDevices = plexDevices;
|
||||||
|
this.plexLibraries = plexLibraries;
|
||||||
this.plexClientInformation = {
|
this.plexClientInformation = {
|
||||||
clientIdentifier: this.clientId, // This is a unique identifier used to identify your app with Plex. - If none is provided a new one is generated and saved locally
|
clientIdentifier: this.clientId, // This is a unique identifier used to identify your app with Plex. - If none is provided a new one is generated and saved locally
|
||||||
product: this.product, // Name of your application - Defaults to Plex-API-OAuth
|
product: this.product, // Name of your application - Defaults to Plex-API-OAuth
|
||||||
@@ -159,8 +109,9 @@ export class PlexAPIOAuth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SavePlexSession() {
|
SavePlexSession() {
|
||||||
console.log("Saving State:");
|
window.localStorage.setItem(
|
||||||
let sessionData = {
|
"plexSessionData",
|
||||||
|
JSON.stringify({
|
||||||
plexTVAuthToken: this.plexTVAuthToken,
|
plexTVAuthToken: this.plexTVAuthToken,
|
||||||
plexTVUserData: this.plexTVUserData,
|
plexTVUserData: this.plexTVUserData,
|
||||||
clientId: this.clientId,
|
clientId: this.clientId,
|
||||||
@@ -170,32 +121,17 @@ export class PlexAPIOAuth {
|
|||||||
forwardUrl: this.forwardUrl,
|
forwardUrl: this.forwardUrl,
|
||||||
platform: this.platform,
|
platform: this.platform,
|
||||||
plexServers: this.plexServers,
|
plexServers: this.plexServers,
|
||||||
plexLibraries: this.plexLibraries,
|
|
||||||
plexMusicLibraries: this.plexMusicLibraries,
|
|
||||||
plexArtistLibraries: this.plexArtistLibraries,
|
|
||||||
plexAlbumLibraries: this.plexAlbumLibraries,
|
|
||||||
plexSongLibraries: this.plexSongLibraries,
|
|
||||||
plexSeasonLibraries: this.plexSeasonLibraries,
|
|
||||||
plexEpisodeLibraries: this.plexEpisodeLibraries,
|
|
||||||
plexMovieLibraries: this.plexMovieLibraries,
|
|
||||||
plexTVShowLibraries: this.plexTVShowLibraries,
|
|
||||||
plexLibraryContent: this.plexLibraryContent,
|
|
||||||
plexMovieLibraryContent: this.plexMovieLibraryContent,
|
|
||||||
plexTVShowLibraryContent: this.plexTVShowLibraryContent,
|
|
||||||
plexDevices: this.plexDevices,
|
plexDevices: this.plexDevices,
|
||||||
|
plexLibraries: this.plexLibraries,
|
||||||
plexClientInformation: this.plexClientInformation,
|
plexClientInformation: this.plexClientInformation,
|
||||||
};
|
})
|
||||||
console.log(sessionData);
|
);
|
||||||
window.localStorage.setItem("plexSessionData", JSON.stringify(sessionData));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadPlexSession() {
|
LoadPlexSession() {
|
||||||
console.log("Loading State:");
|
this.SetPlexSession(
|
||||||
let sessionData = JSON.parse(
|
JSON.parse(window.localStorage?.getItem("plexSessionData") || "{}")
|
||||||
window.localStorage?.getItem("plexSessionData") || "{}"
|
|
||||||
);
|
);
|
||||||
this.SetPlexSession(sessionData);
|
|
||||||
console.log(sessionData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GenerateClientId() {
|
GenerateClientId() {
|
||||||
@@ -354,9 +290,10 @@ export class PlexAPIOAuth {
|
|||||||
return this.plexServers;
|
return this.plexServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
async GetPlexLibraries() {
|
async GetPlexLibraries(servers) {
|
||||||
let libraryArray = [];
|
let libraryArray = [];
|
||||||
for (const server of this.plexServers) {
|
servers = servers || this.plexServers;
|
||||||
|
for (const server of servers) {
|
||||||
let response = await axios({
|
let response = await axios({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url:
|
url:
|
||||||
@@ -397,20 +334,157 @@ export class PlexAPIOAuth {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.plexLibraries = libraryArray;
|
this.plexLibraries = libraryArray;
|
||||||
this.plexMusicLibraries = libraryArray.filter(
|
|
||||||
(Obj) => Obj.type === "artist"
|
|
||||||
);
|
|
||||||
this.plexMovieLibraries = libraryArray.filter(
|
|
||||||
(Obj) => Obj.type === "movie"
|
|
||||||
);
|
|
||||||
this.plexTVShowLibraries = libraryArray.filter(
|
|
||||||
(Obj) => Obj.type === "show"
|
|
||||||
);
|
|
||||||
return this.plexLibraries;
|
return this.plexLibraries;
|
||||||
}
|
}
|
||||||
|
|
||||||
async GetPlexMovieLibraryContent() {
|
async GetPlexMovieLibraries(servers) {
|
||||||
|
let libraryArray = [];
|
||||||
|
servers = servers || this.plexServers;
|
||||||
|
for (const server of servers) {
|
||||||
|
let response = await axios({
|
||||||
|
method: "GET",
|
||||||
|
url:
|
||||||
|
server.relayConnections[0].uri +
|
||||||
|
"/library/sections/?" +
|
||||||
|
qs.stringify({
|
||||||
|
"X-Plex-Token": server.accessToken,
|
||||||
|
}),
|
||||||
|
headers: { accept: "application/json" },
|
||||||
|
}).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
for (const library of response.data.MediaContainer.Directory.filter(
|
||||||
|
(Obj) => Obj.type === "movie"
|
||||||
|
)) {
|
||||||
|
libraryArray.push({
|
||||||
|
server: server,
|
||||||
|
allowSync: library.allowSync,
|
||||||
|
art: library.art,
|
||||||
|
composite: library.composite,
|
||||||
|
filters: library.filters,
|
||||||
|
refreshing: library.refreshing,
|
||||||
|
thumb: library.thumb,
|
||||||
|
key: library.key,
|
||||||
|
type: library.type,
|
||||||
|
title: library.title,
|
||||||
|
agent: library.agent,
|
||||||
|
scanner: library.scanner,
|
||||||
|
language: library.language,
|
||||||
|
uuid: library.uuid,
|
||||||
|
updatedAt: library.updatedAt,
|
||||||
|
createdAt: library.createdAt,
|
||||||
|
scannedAt: library.scannedAt,
|
||||||
|
content: library.content,
|
||||||
|
directory: library.directory,
|
||||||
|
contentChangedAt: library.contentChangedAt,
|
||||||
|
hidden: library.hidden,
|
||||||
|
Location: library.Location,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return libraryArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
async GetPlexMusicLibraries(servers) {
|
||||||
|
let libraryArray = [];
|
||||||
|
servers = servers || this.plexServers;
|
||||||
|
for (const server of servers) {
|
||||||
|
let response = await axios({
|
||||||
|
method: "GET",
|
||||||
|
url:
|
||||||
|
server.relayConnections[0].uri +
|
||||||
|
"/library/sections/?" +
|
||||||
|
qs.stringify({
|
||||||
|
"X-Plex-Token": server.accessToken,
|
||||||
|
}),
|
||||||
|
headers: { accept: "application/json" },
|
||||||
|
}).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
for (const library of response.data.MediaContainer.Directory.filter(
|
||||||
|
(Obj) => Obj.type === "artist"
|
||||||
|
)) {
|
||||||
|
libraryArray.push({
|
||||||
|
server: server,
|
||||||
|
allowSync: library.allowSync,
|
||||||
|
art: library.art,
|
||||||
|
composite: library.composite,
|
||||||
|
filters: library.filters,
|
||||||
|
refreshing: library.refreshing,
|
||||||
|
thumb: library.thumb,
|
||||||
|
key: library.key,
|
||||||
|
type: library.type,
|
||||||
|
title: library.title,
|
||||||
|
agent: library.agent,
|
||||||
|
scanner: library.scanner,
|
||||||
|
language: library.language,
|
||||||
|
uuid: library.uuid,
|
||||||
|
updatedAt: library.updatedAt,
|
||||||
|
createdAt: library.createdAt,
|
||||||
|
scannedAt: library.scannedAt,
|
||||||
|
content: library.content,
|
||||||
|
directory: library.directory,
|
||||||
|
contentChangedAt: library.contentChangedAt,
|
||||||
|
hidden: library.hidden,
|
||||||
|
Location: library.Location,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return libraryArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
async GetPlexTVShowLibraries(servers) {
|
||||||
|
let libraryArray = [];
|
||||||
|
servers = servers || this.plexServers;
|
||||||
|
for (const server of servers) {
|
||||||
|
let response = await axios({
|
||||||
|
method: "GET",
|
||||||
|
url:
|
||||||
|
server.relayConnections[0].uri +
|
||||||
|
"/library/sections/?" +
|
||||||
|
qs.stringify({
|
||||||
|
"X-Plex-Token": server.accessToken,
|
||||||
|
}),
|
||||||
|
headers: { accept: "application/json" },
|
||||||
|
}).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
for (const library of response.data.MediaContainer.Directory.filter(
|
||||||
|
(Obj) => Obj.type === "show"
|
||||||
|
)) {
|
||||||
|
libraryArray.push({
|
||||||
|
server: server,
|
||||||
|
allowSync: library.allowSync,
|
||||||
|
art: library.art,
|
||||||
|
composite: library.composite,
|
||||||
|
filters: library.filters,
|
||||||
|
refreshing: library.refreshing,
|
||||||
|
thumb: library.thumb,
|
||||||
|
key: library.key,
|
||||||
|
type: library.type,
|
||||||
|
title: library.title,
|
||||||
|
agent: library.agent,
|
||||||
|
scanner: library.scanner,
|
||||||
|
language: library.language,
|
||||||
|
uuid: library.uuid,
|
||||||
|
updatedAt: library.updatedAt,
|
||||||
|
createdAt: library.createdAt,
|
||||||
|
scannedAt: library.scannedAt,
|
||||||
|
content: library.content,
|
||||||
|
directory: library.directory,
|
||||||
|
contentChangedAt: library.contentChangedAt,
|
||||||
|
hidden: library.hidden,
|
||||||
|
Location: library.Location,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return libraryArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
async GetPlexMovies(servers, libraries, searchString) {
|
||||||
let movieLibraryContent = [];
|
let movieLibraryContent = [];
|
||||||
|
servers = servers || this.plexServers;
|
||||||
|
libraries = libraries || this.plexLibraries;
|
||||||
for (const server of this.plexServers) {
|
for (const server of this.plexServers) {
|
||||||
for (const library of this.plexLibraries.filter(
|
for (const library of this.plexLibraries.filter(
|
||||||
(Obj) =>
|
(Obj) =>
|
||||||
@@ -426,6 +500,7 @@ export class PlexAPIOAuth {
|
|||||||
"/all?" +
|
"/all?" +
|
||||||
qs.stringify({
|
qs.stringify({
|
||||||
type: 1,
|
type: 1,
|
||||||
|
title: searchString,
|
||||||
"X-Plex-Token": server?.accessToken,
|
"X-Plex-Token": server?.accessToken,
|
||||||
}),
|
}),
|
||||||
headers: { accept: "application/json" },
|
headers: { accept: "application/json" },
|
||||||
@@ -470,6 +545,7 @@ export class PlexAPIOAuth {
|
|||||||
this.plexMovieLibraryContent = movieLibraryContent;
|
this.plexMovieLibraryContent = movieLibraryContent;
|
||||||
return movieLibraryContent;
|
return movieLibraryContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
async GetPlexMusicLibraryContent() {
|
async GetPlexMusicLibraryContent() {
|
||||||
let artistLibraryContent = [];
|
let artistLibraryContent = [];
|
||||||
let albumLibraryContent = [];
|
let albumLibraryContent = [];
|
||||||
@@ -590,6 +666,7 @@ export class PlexAPIOAuth {
|
|||||||
this.plexSongLibraries = songLibraryContent;
|
this.plexSongLibraries = songLibraryContent;
|
||||||
return artistLibraryContent;
|
return artistLibraryContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
async GetPlexTVShowLibraryContent() {
|
async GetPlexTVShowLibraryContent() {
|
||||||
let tvShowLibraryContent = [];
|
let tvShowLibraryContent = [];
|
||||||
let seasonLibraryContent = [];
|
let seasonLibraryContent = [];
|
||||||
@@ -697,16 +774,13 @@ export class PlexAPIOAuth {
|
|||||||
return tvShowLibraryContent;
|
return tvShowLibraryContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
async GetPlexTVShowSeasons(server, searchString) {
|
async GetPlexTVShowSeasons(servers, libraries, searchString) {
|
||||||
let responseArray = [];
|
let responseArray = [];
|
||||||
let queryArray = this.plexServers;
|
servers = servers || this.plexServers;
|
||||||
if (server) {
|
libraries = libraries || this.plexLibraries;
|
||||||
queryArray = this.plexServers.filter((Obj) => (Obj = server));
|
searchString = searchString || "";
|
||||||
}
|
for (const server of servers) {
|
||||||
if (searchString) {
|
for (const showLibrary of libraries.filter(
|
||||||
}
|
|
||||||
for (const server of queryArray) {
|
|
||||||
for (const showLibrary of this.plexTVShowLibraries.filter(
|
|
||||||
(Obj) => Obj.server.clientIdentifier === server.clientIdentifier
|
(Obj) => Obj.server.clientIdentifier === server.clientIdentifier
|
||||||
)) {
|
)) {
|
||||||
let response = await axios({
|
let response = await axios({
|
||||||
@@ -717,7 +791,7 @@ export class PlexAPIOAuth {
|
|||||||
showLibrary?.key +
|
showLibrary?.key +
|
||||||
"/all?" +
|
"/all?" +
|
||||||
qs.stringify({
|
qs.stringify({
|
||||||
title: searchString || null,
|
title: searchString,
|
||||||
type: 3,
|
type: 3,
|
||||||
"X-Plex-Token": server?.accessToken,
|
"X-Plex-Token": server?.accessToken,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ describe("Unit Tests", function () {
|
|||||||
assert.notEqual(PlexSession.plexServers, null);
|
assert.notEqual(PlexSession.plexServers, null);
|
||||||
assert.notEqual(PlexSession.plexServers, undefined);
|
assert.notEqual(PlexSession.plexServers, undefined);
|
||||||
assert.notEqual(PlexSession.plexDevices, emptyArray);
|
assert.notEqual(PlexSession.plexDevices, emptyArray);
|
||||||
|
assert.notEqual(PlexSession.plexDevices, null);
|
||||||
|
assert.notEqual(PlexSession.plexDevices, undefined);
|
||||||
|
assert.notEqual(response, emptyArray);
|
||||||
assert.notEqual(response, null);
|
assert.notEqual(response, null);
|
||||||
|
assert.notEqual(response, undefined);
|
||||||
// console.log("Plex Servers");
|
// console.log("Plex Servers");
|
||||||
// console.log(PlexSession.plexServers);
|
// console.log(PlexSession.plexServers);
|
||||||
});
|
});
|
||||||
@@ -44,60 +48,43 @@ describe("Unit Tests", function () {
|
|||||||
assert.notEqual(PlexSession.plexLibraries, null);
|
assert.notEqual(PlexSession.plexLibraries, null);
|
||||||
assert.notEqual(PlexSession.plexLibraries, undefined);
|
assert.notEqual(PlexSession.plexLibraries, undefined);
|
||||||
assert.notEqual(PlexSession.plexLibraries, emptyArray);
|
assert.notEqual(PlexSession.plexLibraries, emptyArray);
|
||||||
assert.notEqual(PlexSession.plexMusicLibraries, null);
|
assert.notEqual(response, emptyArray);
|
||||||
assert.notEqual(PlexSession.plexMusicLibraries, undefined);
|
assert.notEqual(response, null);
|
||||||
assert.notEqual(PlexSession.plexMusicLibraries, emptyArray);
|
assert.notEqual(response, undefined);
|
||||||
|
// console.log("Plex Libraries");
|
||||||
|
// console.log(PlexSession.plexLibraries);
|
||||||
|
});
|
||||||
|
it("Get Plex Movies Libraries", async function () {
|
||||||
|
this.timeout(10000);
|
||||||
|
let response = await PlexSession.GetPlexMovieLibraries();
|
||||||
assert.notEqual(PlexSession.plexMovieLibraries, null);
|
assert.notEqual(PlexSession.plexMovieLibraries, null);
|
||||||
assert.notEqual(PlexSession.plexMovieLibraries, undefined);
|
assert.notEqual(PlexSession.plexMovieLibraries, undefined);
|
||||||
assert.notEqual(PlexSession.plexMovieLibraries, emptyArray);
|
assert.notEqual(PlexSession.plexMovieLibraries, emptyArray);
|
||||||
|
assert.notEqual(response, emptyArray);
|
||||||
|
assert.notEqual(response, null);
|
||||||
|
assert.notEqual(response, undefined);
|
||||||
|
// console.log("Plex Libraries");
|
||||||
|
// console.log(PlexSession.plexLibraries);
|
||||||
|
});
|
||||||
|
it("Get Plex Music Libraries", async function () {
|
||||||
|
this.timeout(10000);
|
||||||
|
let response = await PlexSession.GetPlexMusicLibraries();
|
||||||
|
assert.notEqual(PlexSession.plexMusicLibraries, null);
|
||||||
|
assert.notEqual(PlexSession.plexMusicLibraries, undefined);
|
||||||
|
assert.notEqual(PlexSession.plexMusicLibraries, emptyArray);
|
||||||
|
assert.notEqual(response, emptyArray);
|
||||||
|
assert.notEqual(response, null);
|
||||||
|
assert.notEqual(response, undefined);
|
||||||
|
// console.log("Plex Libraries");
|
||||||
|
// console.log(PlexSession.plexLibraries);
|
||||||
|
});
|
||||||
|
it("Get Plex TV Libraries", async function () {
|
||||||
|
this.timeout(10000);
|
||||||
|
let response = await PlexSession.GetPlexTVShowLibraries();
|
||||||
assert.notEqual(PlexSession.plexTVShowLibraries, null);
|
assert.notEqual(PlexSession.plexTVShowLibraries, null);
|
||||||
assert.notEqual(PlexSession.plexTVShowLibraries, undefined);
|
assert.notEqual(PlexSession.plexTVShowLibraries, undefined);
|
||||||
assert.notEqual(PlexSession.plexTVShowLibraries, emptyArray);
|
assert.notEqual(PlexSession.plexTVShowLibraries, emptyArray);
|
||||||
// console.log("Plex Libraries");
|
// console.log("Plex Libraries");
|
||||||
// console.log(PlexSession.plexLibraries);
|
// console.log(PlexSession.plexLibraries);
|
||||||
});
|
});
|
||||||
// it("Get Plex Movie Library Contents", async function () {
|
|
||||||
// this.timeout(10000);
|
|
||||||
// let response = await PlexSession.GetPlexMovieLibraryContent();
|
|
||||||
// assert.notEqual(PlexSession.plexMovieLibraryContent, null);
|
|
||||||
// assert.notEqual(PlexSession.plexMovieLibraryContent, undefined);
|
|
||||||
// assert.notEqual(PlexSession.plexMovieLibraryContent, emptyArray);
|
|
||||||
// // console.log("Plex Movie Library Content");
|
|
||||||
// // console.log(PlexSession.plexMovieLibraryContent);
|
|
||||||
// });
|
|
||||||
// it("Get Plex Music Library Contents", async function () {
|
|
||||||
// this.timeout(10000);
|
|
||||||
// let response = await PlexSession.GetPlexMusicLibraryContent();
|
|
||||||
// assert.notEqual(PlexSession.plexArtistLibraries, null);
|
|
||||||
// assert.notEqual(PlexSession.plexArtistLibraries, undefined);
|
|
||||||
// assert.notEqual(PlexSession.plexArtistLibraries, emptyArray);
|
|
||||||
// assert.notEqual(PlexSession.plexAlbumLibraries, null);
|
|
||||||
// assert.notEqual(PlexSession.plexAlbumLibraries, undefined);
|
|
||||||
// assert.notEqual(PlexSession.plexAlbumLibraries, emptyArray);
|
|
||||||
// assert.notEqual(PlexSession.plexSongLibraries, null);
|
|
||||||
// assert.notEqual(PlexSession.plexSongLibraries, undefined);
|
|
||||||
// assert.notEqual(PlexSession.plexSongLibraries, emptyArray);
|
|
||||||
// // console.log("Plex Library Content");
|
|
||||||
// // console.log(PlexSession.plexAlbumLibraries);
|
|
||||||
// });
|
|
||||||
// it("Get Plex TV Library Contents", async function () {
|
|
||||||
// this.timeout(30000);
|
|
||||||
// let response = await PlexSession.GetPlexTVShowLibraryContent();
|
|
||||||
// assert.notEqual(PlexSession.plexTVShowLibraryContent, null);
|
|
||||||
// assert.notEqual(PlexSession.plexTVShowLibraryContent, undefined);
|
|
||||||
// assert.notEqual(PlexSession.plexTVShowLibraryContent, emptyArray);
|
|
||||||
// assert.notEqual(PlexSession.plexSeasonLibraries, null);
|
|
||||||
// assert.notEqual(PlexSession.plexSeasonLibraries, undefined);
|
|
||||||
// assert.notEqual(PlexSession.plexSeasonLibraries, emptyArray);
|
|
||||||
// assert.notEqual(PlexSession.episodeLibraryContent, null);
|
|
||||||
// assert.notEqual(PlexSession.episodeLibraryContent, undefined);
|
|
||||||
// assert.notEqual(PlexSession.episodeLibraryContent, emptyArray);
|
|
||||||
// //console.log("Plex TV Library Content");
|
|
||||||
// //console.log(PlexSession.plexSeasonLibraries);
|
|
||||||
// });
|
|
||||||
it("Get Plex TV Show Seasons - Stateless", async function () {
|
|
||||||
this.timeout(4000);
|
|
||||||
let response = await PlexSession.GetPlexTVShowSeasons();
|
|
||||||
//console.log(response);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user