* `plex-api.libraryPlaylists.addPlaylistItems()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getMetadataHubs()`: * `request.onlyTransient` **Changed** * `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryCollections.moveCollectionItem()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryCollections.deleteCollectionItem()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryCollections.addCollectionItems()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.content.getSonicallySimilar()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.butler.stopTask()`: `request` **Changed** **Breaking** ⚠️ * `plex-api.butler.startTask()`: `request` **Changed** **Breaking** ⚠️ * `plex-api.content.getSonicPath()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.downloadQueue.getItemDecision()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getAllHubs()`: * `request.onlyTransient` **Changed** * `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getContinueWatching()`: `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getPromotedHubs()`: `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.content.getAllLeaves()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getPostplayHubs()`: * `request.onlyTransient` **Changed** * `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getRelatedHubs()`: * `request.onlyTransient` **Changed** * `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.hubs.getSectionHubs()`: * `request.onlyTransient` **Changed** * `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.content.listContent()`: * `request` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.content.getAlbums()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.search.searchHubs()`: `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.search.voiceSearchHubs()`: * `request.type` **Changed** **Breaking** ⚠️ * `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getLibraryItems()`: * `request.mediaQuery` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.ingestTransientItem()`: * `request` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getLibraryMatches()`: * `request` **Changed** **Breaking** ⚠️ * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.content.getMetadataItem()`: * `request` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getSections()`: `response.mediacontainer.directory.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.addSection()`: * `request` **Changed** * `response.mediacontainer.directory.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getTags()`: * `request.type` **Changed** **Breaking** ⚠️ * `plex-api.content.getCollectionItems()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getAllItemLeaves()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.status.listSessions()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.movePlayQueueItem()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getExtras()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.deletePlayQueueItem()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.unshuffle()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.listMatches()`: * `request.manual` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.listSonicallySimilar()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.resetPlayQueue()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getRelatedItems()`: `response.mediacontainer.hub.[].metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.listSimilar()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.clearPlayQueue()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getItemTree()`: `response.mediacontainer.metadataItem.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.addToPlayQueue()`: * `request.next` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.getPlayQueue()`: * `request` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryPlaylists.movePlaylistItem()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getPerson()`: `response.mediacontainer.directory.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.listPersonMedia()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryPlaylists.getPlaylistGeneratorItems()`: `response.mediacontainer.metadata` **Changed** **Breaking** ⚠️ * `plex-api.library.getLibraryDetails()`: * `request.includeDetails` **Changed** * `response.mediacontainer.directory.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryPlaylists.modifyPlaylistGenerator()`: * `request.item` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.autocomplete()`: * `request.mediaQuery` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getCollections()`: * `request.mediaQuery` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.getCommon()`: * `request.mediaQuery` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryPlaylists.deletePlaylistItem()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryPlaylists.clearPlaylistItems()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playQueue.shuffle()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.libraryPlaylists.createPlaylist()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playlist.getPlaylistItems()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playlist.getPlaylist()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.collections.createCollection()`: * `request.type` **Changed** **Breaking** ⚠️ * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.dvRs.tuneChannel()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.liveTv.getSessions()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.liveTv.getLiveTvSession()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.playlist.listPlaylists()`: `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.getAllSubscriptions()`: * `request` **Changed** * `response.mediacontainer.mediaSubscription.[].mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.createSubscription()`: `response.mediacontainer.mediaSubscription.[].mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.getScheduledRecordings()`: `response.mediacontainer.mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.getTemplate()`: `response.mediacontainer.subscriptionTemplate.[].mediaSubscription.[].mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.getSubscription()`: * `request` **Changed** * `response.mediacontainer.mediaSubscription.[].mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.editSubscriptionPreferences()`: `response.mediacontainer.mediaSubscription.[].mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.subscriptions.reorderSubscription()`: `response.mediacontainer.mediaSubscription.[].mediaGrabOperation.[].metadata` **Changed** **Breaking** ⚠️ * `plex-api.transcoder.makeDecision()`: * `request` **Changed** * `response.mediacontainer.metadata.[]` **Changed** **Breaking** ⚠️ * `plex-api.library.refreshItemsMetadata()`: * `request.markUpdated` **Changed** * `plex-api.authentication.postUsersSignInData()`: **Added** * `plex-api.transcoder.startTranscodeSession()`: `request` **Changed** * `plex-api.devices.modifyDevice()`: * `request.enabled` **Changed** * `plex-api.library.getMediaPart()`: * `request.download` **Changed** * `plex-api.library.detectIntros()`: * `request.force` **Changed** * `plex-api.library.refreshSection()`: * `request.force` **Changed** * `plex-api.libraryPlaylists.uploadPlaylist()`: * `request.force` **Changed** * `plex-api.library.deleteMediaItem()`: * `request.proxy` **Changed** * `plex-api.authentication.getTokenDetails()`: **Added** * `plex-api.library.getFirstCharacters()`: * `request.mediaQuery` **Changed** * `plex-api.library.updateItems()`: * `request.field.locked` **Changed** * `plex-api.library.deleteLibrarySection()`: * `request.async` **Changed** * `plex-api.library.setStreamSelection()`: * `request.allParts` **Changed** * `plex-api.playQueue.createPlayQueue()`: `request` **Changed** * `plex-api.library.getAugmentationStatus()`: * `request.wait` **Changed** * `plex-api.library.detectVoiceActivity()`: `request` **Changed** * `plex-api.transcoder.transcodeImage()`: `request` **Changed** * `plex-api.transcoder.transcodeSubtitles()`: `request` **Changed** * `plex-api.library.addSubtitles()`: `request` **Changed** * `plex-api.library.getStream()`: * `request.autoAdjustSubtitle` **Changed** * `plex-api.library.startBifGeneration()`: * `request.force` **Changed** * `plex-api.library.detectCredits()`: `request` **Changed** * `plex-api.ultraBlur.getImage()`: * `request.noise` **Changed** * `plex-api.library.generateThumbs()`: * `request.force` **Changed** * `plex-api.updater.applyUpdates()`: `request` **Changed** * `plex-api.updater.checkUpdates()`: * `request.download` **Changed** * `plex-api.library.deleteMetadataItem()`: * `request.proxy` **Changed** * `plex-api.library.optimizeDatabase()`: * `request.async` **Changed** * `plex-api.hubs.updateHubVisibility()`: `request` **Changed** * `plex-api.hubs.createCustomHub()`: `request` **Changed** * `plex-api.library.getSectionImage()`: * `request.mediaQuery` **Changed** * `plex-api.downloadQueue.addDownloadQueueItems()`: `request` **Changed** * `plex-api.timeline.report()`: `request` **Changed** * `plex-api.general.getSourceConnectionInformation()`: * `request.refresh` **Changed** * `plex-api.plex.getServerResources()`: **Added** * `plex-api.users.getUsers()`: **Added**
DownloadQueue
(downloadQueue)
Overview
API Operations against the Download Queue
Available Operations
- createDownloadQueue - Create download queue
- getDownloadQueue - Get a download queue
- addDownloadQueueItems - Add to download queue
- listDownloadQueueItems - Get download queue items
- getItemDecision - Grab download queue item decision
- getDownloadQueueMedia - Grab download queue media
- removeDownloadQueueItems - Delete download queue items
- getDownloadQueueItems - Get download queue items
- restartProcessingDownloadQueueItems - Restart processing of items from the decision
createDownloadQueue
Available: 0.2.0
Creates a download queue for this client if one doesn't exist, or returns the existing queue for this client and user.
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.createDownloadQueue();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueCreateDownloadQueue } from "@lukehagar/plexjs/funcs/downloadQueueCreateDownloadQueue.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueCreateDownloadQueue(plexAPI);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueCreateDownloadQueue failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.CreateDownloadQueueResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
getDownloadQueue
Available: 0.2.0
Get a download queue by its id
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getDownloadQueue({
queueId: 922802,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueGetDownloadQueue } from "@lukehagar/plexjs/funcs/downloadQueueGetDownloadQueue.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueGetDownloadQueue(plexAPI, {
queueId: 922802,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueGetDownloadQueue failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDownloadQueueRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetDownloadQueueResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
addDownloadQueueItems
Available: 0.2.0
Add items to the download queue
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, AdvancedSubtitles, BoolInt, LocationParameter, ProtocolParameter } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.addDownloadQueueItems({
queueId: 984925,
keys: [
"/library/metadata/3",
"/library/metadata/6",
],
advancedSubtitles: AdvancedSubtitles.Burn,
audioBoost: 50,
audioChannelCount: 5,
autoAdjustQuality: BoolInt.True,
autoAdjustSubtitle: BoolInt.True,
directPlay: BoolInt.True,
directStream: BoolInt.True,
directStreamAudio: BoolInt.True,
disableResolutionRotation: BoolInt.True,
hasMDE: BoolInt.True,
location: LocationParameter.Wan,
mediaBufferSize: 102400,
mediaIndex: 0,
musicBitrate: 5000,
offset: 90.5,
partIndex: 0,
path: "/library/metadata/151671",
peakBitrate: 12000,
photoResolution: "1080x1080",
protocol: ProtocolParameter.Dash,
secondsPerSegment: 5,
subtitleSize: 50,
videoBitrate: 12000,
videoQuality: 50,
videoResolution: "1080x1080",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueAddDownloadQueueItems } from "@lukehagar/plexjs/funcs/downloadQueueAddDownloadQueueItems.js";
import { Accepts, AdvancedSubtitles, BoolInt, LocationParameter, ProtocolParameter } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueAddDownloadQueueItems(plexAPI, {
queueId: 984925,
keys: [
"/library/metadata/3",
"/library/metadata/6",
],
advancedSubtitles: AdvancedSubtitles.Burn,
audioBoost: 50,
audioChannelCount: 5,
autoAdjustQuality: BoolInt.True,
autoAdjustSubtitle: BoolInt.True,
directPlay: BoolInt.True,
directStream: BoolInt.True,
directStreamAudio: BoolInt.True,
disableResolutionRotation: BoolInt.True,
hasMDE: BoolInt.True,
location: LocationParameter.Wan,
mediaBufferSize: 102400,
mediaIndex: 0,
musicBitrate: 5000,
offset: 90.5,
partIndex: 0,
path: "/library/metadata/151671",
peakBitrate: 12000,
photoResolution: "1080x1080",
protocol: ProtocolParameter.Dash,
secondsPerSegment: 5,
subtitleSize: 50,
videoBitrate: 12000,
videoQuality: 50,
videoResolution: "1080x1080",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueAddDownloadQueueItems failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AddDownloadQueueItemsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.AddDownloadQueueItemsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
listDownloadQueueItems
Available: 0.2.0
Get items from a download queue
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.listDownloadQueueItems({
queueId: 524138,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueListDownloadQueueItems } from "@lukehagar/plexjs/funcs/downloadQueueListDownloadQueueItems.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueListDownloadQueueItems(plexAPI, {
queueId: 524138,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueListDownloadQueueItems failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ListDownloadQueueItemsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListDownloadQueueItemsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
getItemDecision
Available: 0.2.0
Grab the decision for a download queue item
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getItemDecision({
queueId: 231605,
itemId: 32,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueGetItemDecision } from "@lukehagar/plexjs/funcs/downloadQueueGetItemDecision.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueGetItemDecision(plexAPI, {
queueId: 231605,
itemId: 32,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueGetItemDecision failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetItemDecisionRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetItemDecisionResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
getDownloadQueueMedia
Available: 0.2.0
Grab the media for a download queue item
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getDownloadQueueMedia({
queueId: 663184,
itemId: 32,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueGetDownloadQueueMedia } from "@lukehagar/plexjs/funcs/downloadQueueGetDownloadQueueMedia.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueGetDownloadQueueMedia(plexAPI, {
queueId: 663184,
itemId: 32,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueGetDownloadQueueMedia failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDownloadQueueMediaRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetDownloadQueueMediaResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
removeDownloadQueueItems
delete items from a download queue
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.removeDownloadQueueItems({
queueId: 946275,
itemId: [
32,
345,
23,
],
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueRemoveDownloadQueueItems } from "@lukehagar/plexjs/funcs/downloadQueueRemoveDownloadQueueItems.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueRemoveDownloadQueueItems(plexAPI, {
queueId: 946275,
itemId: [
32,
345,
23,
],
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueRemoveDownloadQueueItems failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.RemoveDownloadQueueItemsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.RemoveDownloadQueueItemsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
getDownloadQueueItems
Available: 0.2.0
Get items from a download queue
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getDownloadQueueItems({
queueId: 809886,
itemId: [
32,
345,
23,
],
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueGetDownloadQueueItems } from "@lukehagar/plexjs/funcs/downloadQueueGetDownloadQueueItems.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueGetDownloadQueueItems(plexAPI, {
queueId: 809886,
itemId: [
32,
345,
23,
],
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueGetDownloadQueueItems failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDownloadQueueItemsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetDownloadQueueItemsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
restartProcessingDownloadQueueItems
Available: 0.2.0
Reprocess download queue items with previous decision parameters
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.restartProcessingDownloadQueueItems({
queueId: 713001,
itemId: [
32,
345,
23,
],
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { downloadQueueRestartProcessingDownloadQueueItems } from "@lukehagar/plexjs/funcs/downloadQueueRestartProcessingDownloadQueueItems.js";
import { Accepts } from "@lukehagar/plexjs/sdk/models/shared";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await downloadQueueRestartProcessingDownloadQueueItems(plexAPI, {
queueId: 713001,
itemId: [
32,
345,
23,
],
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("downloadQueueRestartProcessingDownloadQueueItems failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.RestartProcessingDownloadQueueItemsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.RestartProcessingDownloadQueueItemsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |