@ctrl/plex 1.5.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/src/alert.d.ts +12 -0
- package/dist/src/alert.js +29 -0
- package/dist/src/alert.types.d.ts +59 -0
- package/dist/src/alert.types.js +1 -0
- package/dist/{base → src/base}/partialPlexObject.d.ts +18 -12
- package/dist/{base → src/base}/partialPlexObject.js +29 -23
- package/dist/{base → src/base}/playable.d.ts +2 -2
- package/dist/src/base/playable.js +8 -0
- package/dist/{base → src/base}/plexObject.d.ts +8 -1
- package/dist/{base → src/base}/plexObject.js +21 -18
- package/dist/{baseFunctionality.d.ts → src/baseFunctionality.d.ts} +17 -1
- package/dist/{baseFunctionality.js → src/baseFunctionality.js} +7 -15
- package/dist/{client.d.ts → src/client.d.ts} +2 -2
- package/dist/{client.js → src/client.js} +12 -20
- package/dist/src/client.types.js +1 -0
- package/dist/src/config.js +35 -0
- package/dist/src/exceptions.d.ts +20 -0
- package/dist/src/exceptions.js +40 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +11 -0
- package/dist/{library.d.ts → src/library.d.ts} +207 -21
- package/dist/{library.js → src/library.js} +348 -132
- package/dist/{library.types.d.ts → src/library.types.d.ts} +59 -1
- package/dist/src/library.types.js +1 -0
- package/dist/{media.d.ts → src/media.d.ts} +16 -4
- package/dist/{media.js → src/media.js} +42 -49
- package/dist/src/media.types.d.ts +7 -0
- package/dist/src/media.types.js +1 -0
- package/dist/{myplex.d.ts → src/myplex.d.ts} +16 -6
- package/dist/{myplex.js → src/myplex.js} +71 -57
- package/dist/src/myplex.types.js +10 -0
- package/dist/src/playlist.d.ts +75 -0
- package/dist/src/playlist.js +142 -0
- package/dist/src/playlist.types.d.ts +17 -0
- package/dist/src/playlist.types.js +1 -0
- package/dist/{search.d.ts → src/search.d.ts} +4 -3
- package/dist/{search.js → src/search.js} +13 -19
- package/dist/src/search.types.js +1 -0
- package/dist/{server.d.ts → src/server.d.ts} +22 -10
- package/dist/{server.js → src/server.js} +65 -50
- package/dist/src/server.types.js +1 -0
- package/dist/src/settings.d.ts +79 -0
- package/dist/src/settings.js +160 -0
- package/dist/{util.d.ts → src/util.d.ts} +2 -1
- package/dist/{util.js → src/util.js} +8 -12
- package/dist/{video.d.ts → src/video.d.ts} +38 -60
- package/dist/{video.js → src/video.js} +109 -92
- package/dist/{video.types.d.ts → src/video.types.d.ts} +1 -1
- package/dist/src/video.types.js +6 -0
- package/package.json +46 -44
- package/dist/base/playable.js +0 -12
- package/dist/client.types.js +0 -2
- package/dist/config.js +0 -41
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -23
- package/dist/library.types.js +0 -2
- package/dist/myplex.types.js +0 -13
- package/dist/playlist.d.ts +0 -7
- package/dist/playlist.js +0 -19
- package/dist/search.types.js +0 -2
- package/dist/server.types.js +0 -2
- package/dist/video.types.js +0 -9
- /package/dist/{client.types.d.ts → src/client.types.d.ts} +0 -0
- /package/dist/{config.d.ts → src/config.d.ts} +0 -0
- /package/dist/{myplex.types.d.ts → src/myplex.types.d.ts} +0 -0
- /package/dist/{search.types.d.ts → src/search.types.d.ts} +0 -0
- /package/dist/{server.types.d.ts → src/server.types.d.ts} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { PlexObject } from './base/plexObject.js';
|
|
2
|
+
export interface SettingResponse {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
type: Type;
|
|
7
|
+
default: boolean | number | string;
|
|
8
|
+
value: boolean | number | string;
|
|
9
|
+
hidden: boolean;
|
|
10
|
+
advanced: boolean;
|
|
11
|
+
group: SettingsGroup;
|
|
12
|
+
}
|
|
13
|
+
declare enum SettingsGroup {
|
|
14
|
+
Butler = "butler",
|
|
15
|
+
Channels = "channels",
|
|
16
|
+
Dlna = "dlna",
|
|
17
|
+
Empty = "",
|
|
18
|
+
Extras = "extras",
|
|
19
|
+
General = "general",
|
|
20
|
+
Library = "library",
|
|
21
|
+
Network = "network",
|
|
22
|
+
Transcoder = "transcoder"
|
|
23
|
+
}
|
|
24
|
+
declare enum Type {
|
|
25
|
+
Bool = "bool",
|
|
26
|
+
Double = "double",
|
|
27
|
+
Int = "int",
|
|
28
|
+
Text = "text"
|
|
29
|
+
}
|
|
30
|
+
export declare class Settings extends PlexObject {
|
|
31
|
+
static key: string;
|
|
32
|
+
_settings: Record<string, Setting>;
|
|
33
|
+
_data: SettingResponse[];
|
|
34
|
+
all(): Setting[];
|
|
35
|
+
get(id: string): Setting;
|
|
36
|
+
/**
|
|
37
|
+
* Save any outstanding settnig changes to the PlexServer. This
|
|
38
|
+
* performs a full reload() of Settings after complete.
|
|
39
|
+
*/
|
|
40
|
+
save(): Promise<void>;
|
|
41
|
+
_loadData(data: SettingResponse[]): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Represents a single Plex setting
|
|
45
|
+
*/
|
|
46
|
+
export declare class Setting extends PlexObject {
|
|
47
|
+
/** Setting id (or name). */
|
|
48
|
+
id: string;
|
|
49
|
+
/** Short description of what this setting is. */
|
|
50
|
+
label: string;
|
|
51
|
+
/** Long description of what this setting is. */
|
|
52
|
+
summary: string;
|
|
53
|
+
/** Setting type (text, int, double, bool). */
|
|
54
|
+
type: string;
|
|
55
|
+
/** Default value for this setting. */
|
|
56
|
+
default: string | boolean | number;
|
|
57
|
+
/** Current value for this setting. */
|
|
58
|
+
value: string | boolean | number;
|
|
59
|
+
/** True if this is a hidden setting. */
|
|
60
|
+
hidden: boolean;
|
|
61
|
+
/** True if this is an advanced setting. */
|
|
62
|
+
advanced: boolean;
|
|
63
|
+
/** Group name this setting is categorized as. */
|
|
64
|
+
group: string;
|
|
65
|
+
/** List or dictionary of valis values for this setting. */
|
|
66
|
+
enumValues: any[] | any;
|
|
67
|
+
_setValue: string | boolean | number | null;
|
|
68
|
+
/**
|
|
69
|
+
* Set a new value for this setitng. NOTE: You must call {@link Settings.save} before
|
|
70
|
+
* any changes to setting values are persisted to the PlexServer.
|
|
71
|
+
*/
|
|
72
|
+
set(value: string | boolean | number): void;
|
|
73
|
+
_loadData(data: SettingResponse): void;
|
|
74
|
+
}
|
|
75
|
+
export declare class Preferences extends Setting {
|
|
76
|
+
static TAG: "Preferences";
|
|
77
|
+
FILTER: "preferences";
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { URLSearchParams } from 'url';
|
|
2
|
+
import { PlexObject } from './base/plexObject.js';
|
|
3
|
+
import { NotFound } from './exceptions.js';
|
|
4
|
+
import { lowerFirst } from './util.js';
|
|
5
|
+
var SettingsGroup;
|
|
6
|
+
(function (SettingsGroup) {
|
|
7
|
+
SettingsGroup["Butler"] = "butler";
|
|
8
|
+
SettingsGroup["Channels"] = "channels";
|
|
9
|
+
SettingsGroup["Dlna"] = "dlna";
|
|
10
|
+
SettingsGroup["Empty"] = "";
|
|
11
|
+
SettingsGroup["Extras"] = "extras";
|
|
12
|
+
SettingsGroup["General"] = "general";
|
|
13
|
+
SettingsGroup["Library"] = "library";
|
|
14
|
+
SettingsGroup["Network"] = "network";
|
|
15
|
+
SettingsGroup["Transcoder"] = "transcoder";
|
|
16
|
+
})(SettingsGroup || (SettingsGroup = {}));
|
|
17
|
+
var Type;
|
|
18
|
+
(function (Type) {
|
|
19
|
+
Type["Bool"] = "bool";
|
|
20
|
+
Type["Double"] = "double";
|
|
21
|
+
Type["Int"] = "int";
|
|
22
|
+
Type["Text"] = "text";
|
|
23
|
+
})(Type || (Type = {}));
|
|
24
|
+
export class Settings extends PlexObject {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this._data = [];
|
|
28
|
+
}
|
|
29
|
+
static { this.key = '/:/prefs'; }
|
|
30
|
+
all() {
|
|
31
|
+
return Object.entries(this._settings)
|
|
32
|
+
.sort((a, b) => a[0].localeCompare(b[0]))
|
|
33
|
+
.map(x => x[1]);
|
|
34
|
+
}
|
|
35
|
+
get(id) {
|
|
36
|
+
const lowerId = lowerFirst(id);
|
|
37
|
+
if (this._settings[lowerId]) {
|
|
38
|
+
return this._settings[lowerId];
|
|
39
|
+
}
|
|
40
|
+
throw new NotFound(`Invalid setting id: ${id}`);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Save any outstanding settnig changes to the PlexServer. This
|
|
44
|
+
* performs a full reload() of Settings after complete.
|
|
45
|
+
*/
|
|
46
|
+
async save() {
|
|
47
|
+
const params = new URLSearchParams();
|
|
48
|
+
for (const setting of this.all()) {
|
|
49
|
+
if (setting._setValue !== null) {
|
|
50
|
+
params.append('setting.id', JSON.stringify(setting._setValue));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const url = `${this.key}?${params.toString()}`;
|
|
54
|
+
await this.server.query(url, 'put');
|
|
55
|
+
}
|
|
56
|
+
_loadData(data) {
|
|
57
|
+
this._data = data;
|
|
58
|
+
this._settings = this._settings ?? {};
|
|
59
|
+
for (const elem of data) {
|
|
60
|
+
const id = lowerFirst(elem.id);
|
|
61
|
+
if (this._settings[id]) {
|
|
62
|
+
this._settings[id]._loadData(elem);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
this._settings[id] = new Setting(this.server, elem, this.initpath);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Represents a single Plex setting
|
|
71
|
+
*/
|
|
72
|
+
export class Setting extends PlexObject {
|
|
73
|
+
constructor() {
|
|
74
|
+
super(...arguments);
|
|
75
|
+
this._setValue = null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Set a new value for this setitng. NOTE: You must call {@link Settings.save} before
|
|
79
|
+
* any changes to setting values are persisted to the PlexServer.
|
|
80
|
+
*/
|
|
81
|
+
set(value) {
|
|
82
|
+
if (typeof value !== typeof this.value) {
|
|
83
|
+
throw new Error('Invalid type');
|
|
84
|
+
}
|
|
85
|
+
this._setValue = value;
|
|
86
|
+
}
|
|
87
|
+
_loadData(data) {
|
|
88
|
+
// this._setValue = None
|
|
89
|
+
this.id = data.id;
|
|
90
|
+
this.label = data.label;
|
|
91
|
+
this.summary = data.summary;
|
|
92
|
+
this.type = data.type;
|
|
93
|
+
this.default = data.default;
|
|
94
|
+
this.value = data.value;
|
|
95
|
+
this.hidden = data.hidden;
|
|
96
|
+
this.advanced = data.advanced;
|
|
97
|
+
this.group = data.group;
|
|
98
|
+
// this.enumValues = this._getEnumValues(data);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export class Preferences extends Setting {
|
|
102
|
+
constructor() {
|
|
103
|
+
super(...arguments);
|
|
104
|
+
this.FILTER = 'preferences';
|
|
105
|
+
}
|
|
106
|
+
static { this.TAG = 'Preferences'; }
|
|
107
|
+
}
|
|
108
|
+
// class Setting(PlexObject):
|
|
109
|
+
// """ Represents a single Plex setting.
|
|
110
|
+
// _bool_cast = lambda x: True if x == 'true' or x == '1' else False
|
|
111
|
+
// _bool_str = lambda x: str(x).lower()
|
|
112
|
+
// _str = lambda x: str(x).encode('utf-8')
|
|
113
|
+
// TYPES = {
|
|
114
|
+
// 'bool': {'type': bool, 'cast': _bool_cast, 'tostr': _bool_str},
|
|
115
|
+
// 'double': {'type': float, 'cast': float, 'tostr': _str},
|
|
116
|
+
// 'int': {'type': int, 'cast': int, 'tostr': _str},
|
|
117
|
+
// 'text': {'type': str, 'cast': _str, 'tostr': _str},
|
|
118
|
+
// }
|
|
119
|
+
// def _loadData(self, data):
|
|
120
|
+
// """ Load attribute values from Plex XML response. """
|
|
121
|
+
// this._setValue = None
|
|
122
|
+
// this.id = data.('id')
|
|
123
|
+
// this.label = data.('label')
|
|
124
|
+
// this.summary = data.('summary')
|
|
125
|
+
// this.type = data.('type')
|
|
126
|
+
// this.default = this._cast(data.('default'))
|
|
127
|
+
// this.value = this._cast(data.('value'))
|
|
128
|
+
// this.hidden = utils.cast(bool, data.('hidden'))
|
|
129
|
+
// this.advanced = utils.cast(bool, data.('advanced'))
|
|
130
|
+
// this.group = data.('group')
|
|
131
|
+
// this.enumValues = this._getEnumValues(data)
|
|
132
|
+
// def _cast(self, value):
|
|
133
|
+
// """ Cast the specific value to the type of this setting. """
|
|
134
|
+
// if this.type != 'enum':
|
|
135
|
+
// value = utils.cast(this.TYPES.get(this.type)['cast'], value)
|
|
136
|
+
// return value
|
|
137
|
+
// def _getEnumValues(self, data):
|
|
138
|
+
// """ Returns a list of dictionary of valis value for this setting. """
|
|
139
|
+
// enumstr = data.('enumValues')
|
|
140
|
+
// if not enumstr:
|
|
141
|
+
// return None
|
|
142
|
+
// if ':' in enumstr:
|
|
143
|
+
// return {this._cast(k): v for k, v in [kv.split(':') for kv in enumstr.split('|')]}
|
|
144
|
+
// return enumstr.split('|')
|
|
145
|
+
// def set(self, value):
|
|
146
|
+
// """ Set a new value for this setitng. NOTE: You must call plex.settings.save() for before
|
|
147
|
+
// any changes to setting values are persisted to the :class:`~plexapi.server.PlexServer`.
|
|
148
|
+
// """
|
|
149
|
+
// # check a few things up front
|
|
150
|
+
// if not isinstance(value, this.TYPES[this.type]['type']):
|
|
151
|
+
// badtype = type(value).__name__
|
|
152
|
+
// raise BadRequest('Invalid value for %s: a %s is required, not %s' % (this.id, this.type, badtype))
|
|
153
|
+
// if this.enumValues and value not in this.enumValues:
|
|
154
|
+
// raise BadRequest('Invalid value for %s: %s not in %s' % (this.id, value, list(this.enumValues)))
|
|
155
|
+
// # store value off to the side until we call settings.save()
|
|
156
|
+
// tostr = this.TYPES[this.type]['tostr']
|
|
157
|
+
// this._setValue = tostr(value)
|
|
158
|
+
// def toUrl(self):
|
|
159
|
+
// """Helper for urls"""
|
|
160
|
+
// return '%s=%s' % (this.id, this._value or this.value)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Section } from './library';
|
|
1
|
+
import type { Section } from './library.js';
|
|
2
2
|
export interface MediaContainer<T> {
|
|
3
3
|
MediaContainer: T;
|
|
4
4
|
}
|
|
@@ -17,3 +17,4 @@ export declare function getAgentIdentifier(section: Section, agent: string): Pro
|
|
|
17
17
|
/** Simple tag helper for editing a object. */
|
|
18
18
|
export declare function tagHelper(tag: string, items: string[], locked?: boolean, remove?: boolean): Record<string, string | number>;
|
|
19
19
|
export declare function ltrim(x: string, characters: string[]): string;
|
|
20
|
+
export declare function lowerFirst(str: string): string;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ltrim = exports.tagHelper = exports.getAgentIdentifier = exports.rsplit = void 0;
|
|
4
|
-
function rsplit(str, sep, maxsplit) {
|
|
5
|
-
var split = str.split(sep);
|
|
1
|
+
export function rsplit(str, sep, maxsplit) {
|
|
2
|
+
const split = str.split(sep);
|
|
6
3
|
return maxsplit ? [split.slice(0, -maxsplit).join(sep)].concat(split.slice(-maxsplit)) : split;
|
|
7
4
|
}
|
|
8
|
-
exports.rsplit = rsplit;
|
|
9
5
|
/**
|
|
10
6
|
* Return the full agent identifier from a short identifier, name, or confirm full identifier.
|
|
11
7
|
* @param section
|
|
12
8
|
* @param agent
|
|
13
9
|
*/
|
|
14
|
-
async function getAgentIdentifier(section, agent) {
|
|
10
|
+
export async function getAgentIdentifier(section, agent) {
|
|
15
11
|
const agents = [];
|
|
16
12
|
for (const ag of await section.agents()) {
|
|
17
13
|
const identifiers = [ag.identifier, ag.shortIdentifier, ag.name];
|
|
@@ -22,9 +18,8 @@ async function getAgentIdentifier(section, agent) {
|
|
|
22
18
|
}
|
|
23
19
|
throw new Error(`Couldnt find "${agent}" in agents list (${agents.join(', ')})`);
|
|
24
20
|
}
|
|
25
|
-
exports.getAgentIdentifier = getAgentIdentifier;
|
|
26
21
|
/** Simple tag helper for editing a object. */
|
|
27
|
-
function tagHelper(tag, items, locked = true, remove = false) {
|
|
22
|
+
export function tagHelper(tag, items, locked = true, remove = false) {
|
|
28
23
|
const data = {};
|
|
29
24
|
if (remove) {
|
|
30
25
|
const tagname = `${tag}[].tag.tag-`;
|
|
@@ -40,8 +35,7 @@ function tagHelper(tag, items, locked = true, remove = false) {
|
|
|
40
35
|
data[`${tag}.locked`] = locked ? 1 : 0;
|
|
41
36
|
return data;
|
|
42
37
|
}
|
|
43
|
-
|
|
44
|
-
function ltrim(x, characters) {
|
|
38
|
+
export function ltrim(x, characters) {
|
|
45
39
|
let start = 0;
|
|
46
40
|
while (characters.includes(x[start])) {
|
|
47
41
|
start += 1;
|
|
@@ -49,4 +43,6 @@ function ltrim(x, characters) {
|
|
|
49
43
|
const end = x.length - 1;
|
|
50
44
|
return x.substr(start, end);
|
|
51
45
|
}
|
|
52
|
-
|
|
46
|
+
export function lowerFirst(str) {
|
|
47
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
48
|
+
}
|
|
@@ -1,40 +1,29 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { URL } from 'url';
|
|
3
|
-
import { Playable } from './base/playable';
|
|
4
|
-
import { FullShowData, MovieData, ShowData } from './library.types';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export declare type VideoType = Movie | Show;
|
|
3
|
+
import { Playable } from './base/playable.js';
|
|
4
|
+
import { ExtrasData, FullShowData, MovieData, ShowData } from './library.types.js';
|
|
5
|
+
import { Chapter, Collection, Country, Director, Genre, Guid, Marker, Media, Producer, Role, Similar, Writer } from './media.js';
|
|
6
|
+
import { ChapterSource, EpisodeMetadata, FullMovieResponse } from './video.types.js';
|
|
7
|
+
export type VideoType = Movie | Show;
|
|
9
8
|
declare abstract class Video extends Playable {
|
|
10
|
-
server: PlexServer;
|
|
11
|
-
/** API URL (/library/metadata/<ratingkey>) */
|
|
12
|
-
key: string;
|
|
13
9
|
/** Datetime this item was added to the library. */
|
|
14
10
|
addedAt: Date;
|
|
15
11
|
/** Datetime item was last accessed. */
|
|
16
12
|
lastViewedAt?: Date;
|
|
17
13
|
/** Hardcoded as 'video' (useful for search filters). */
|
|
18
14
|
listType: "video";
|
|
19
|
-
/** Unique key identifying this item. */
|
|
20
|
-
ratingKey: string;
|
|
21
15
|
/** Summary of the artist, track, or album. */
|
|
22
16
|
summary: string;
|
|
23
17
|
/** URL to thumbnail image. */
|
|
24
18
|
thumb: string;
|
|
25
|
-
/** Artist, Album or Track title. (Jason Mraz, We Sing, Lucky, etc.) */
|
|
26
|
-
title: string;
|
|
27
19
|
/** Title to use when sorting (defaults to title). */
|
|
28
20
|
titleSort?: string;
|
|
29
|
-
/** 'artist', 'album', or 'track'. */
|
|
30
|
-
type: string;
|
|
31
21
|
/** Datetime this item was updated. */
|
|
32
22
|
updatedAt?: Date;
|
|
33
23
|
/** Count of times this item was accessed. */
|
|
34
24
|
viewCount?: number;
|
|
35
25
|
art?: string;
|
|
36
26
|
grandparentArt?: string;
|
|
37
|
-
constructor(server: PlexServer, data: MovieData | EpisodeMetadata, initpath: string, parent?: any);
|
|
38
27
|
/**
|
|
39
28
|
* Returns True if this video is watched.
|
|
40
29
|
*/
|
|
@@ -54,6 +43,7 @@ declare abstract class Video extends Playable {
|
|
|
54
43
|
*/
|
|
55
44
|
markUnwatched(): Promise<void>;
|
|
56
45
|
rate(rate: number): Promise<void>;
|
|
46
|
+
extras(): Promise<Extra[]>;
|
|
57
47
|
protected _loadData(data: MovieData | ShowData | EpisodeMetadata): void;
|
|
58
48
|
}
|
|
59
49
|
/**
|
|
@@ -63,9 +53,6 @@ export declare class Movie extends Video {
|
|
|
63
53
|
TAG: string;
|
|
64
54
|
TYPE: string;
|
|
65
55
|
METADATA_TYPE: string;
|
|
66
|
-
/** Key to movie artwork (/library/metadata/<ratingkey>/art/<artid>) */
|
|
67
|
-
art: string;
|
|
68
|
-
librarySectionID?: number;
|
|
69
56
|
/** Audience rating (usually from Rotten Tomatoes). */
|
|
70
57
|
audienceRating?: number;
|
|
71
58
|
/** Key to audience rating image (rottentomatoes://image.rating.spilled) */
|
|
@@ -78,8 +65,8 @@ export declare class Movie extends Video {
|
|
|
78
65
|
duration: number;
|
|
79
66
|
/** Original title, often the foreign title (転々; 엽기적인 그녀). */
|
|
80
67
|
originalTitle?: string;
|
|
81
|
-
/**
|
|
82
|
-
originallyAvailableAt:
|
|
68
|
+
/** YYYY-MM-DD movie was released. */
|
|
69
|
+
originallyAvailableAt: string;
|
|
83
70
|
/** Primary extra key (/library/metadata/66351). */
|
|
84
71
|
primaryExtraKey: string;
|
|
85
72
|
/** Movie rating (7.9; 9.8; 8.1). */
|
|
@@ -94,8 +81,6 @@ export declare class Movie extends Video {
|
|
|
94
81
|
userRating?: number;
|
|
95
82
|
/** View offset in milliseconds. */
|
|
96
83
|
viewOffset: number;
|
|
97
|
-
/** Year movie was released. */
|
|
98
|
-
year: number;
|
|
99
84
|
/** Plex GUID (com.plexapp.agents.imdb://tt4302938?lang=en) */
|
|
100
85
|
guid: string;
|
|
101
86
|
directors: Director[];
|
|
@@ -108,8 +93,18 @@ export declare class Movie extends Video {
|
|
|
108
93
|
roles: Role[];
|
|
109
94
|
similar: Similar[];
|
|
110
95
|
media: Media[];
|
|
96
|
+
guids: Guid[];
|
|
97
|
+
markers: Marker[];
|
|
111
98
|
get actors(): Role[];
|
|
112
99
|
locations(): Promise<string[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns True if this movie has an intro marker
|
|
102
|
+
*/
|
|
103
|
+
hasIntroMarker(): Promise<boolean>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns True if this movie has a credits marker
|
|
106
|
+
*/
|
|
107
|
+
hasCreditsMarker(): Promise<boolean>;
|
|
113
108
|
protected _loadData(data: MovieData): void;
|
|
114
109
|
protected _loadFullData(data: FullMovieResponse): void;
|
|
115
110
|
}
|
|
@@ -120,8 +115,6 @@ export declare class Show extends Video {
|
|
|
120
115
|
TAG: string;
|
|
121
116
|
TYPE: string;
|
|
122
117
|
METADATA_TYPE: string;
|
|
123
|
-
/** Key to show artwork (/library/metadata/<ratingkey>/art/<artid>) */
|
|
124
|
-
art: string;
|
|
125
118
|
/** Key to banner artwork (/library/metadata/<ratingkey>/art/<artid>) */
|
|
126
119
|
banner: string;
|
|
127
120
|
/** Unknown. */
|
|
@@ -147,8 +140,6 @@ export declare class Show extends Video {
|
|
|
147
140
|
theme: string;
|
|
148
141
|
/** Unknown. */
|
|
149
142
|
viewedLeafCount: number;
|
|
150
|
-
/** Year the show was released. */
|
|
151
|
-
year: number;
|
|
152
143
|
/** List of genre objects. */
|
|
153
144
|
genres: Genre[];
|
|
154
145
|
/** List of role objects. */
|
|
@@ -195,24 +186,16 @@ export declare class Season extends Video {
|
|
|
195
186
|
protected _loadData(data: ShowData): void;
|
|
196
187
|
protected _loadFullData(data: ShowData): void;
|
|
197
188
|
}
|
|
198
|
-
declare class Episode extends Video {
|
|
189
|
+
export declare class Episode extends Video {
|
|
199
190
|
static TAG: string;
|
|
200
191
|
TYPE: string;
|
|
201
192
|
METADATA_TYPE: string;
|
|
202
|
-
/**
|
|
203
|
-
* Name of this Episode
|
|
204
|
-
*/
|
|
205
|
-
title: string;
|
|
206
|
-
/** Key to episode artwork (/library/metadata/<ratingkey>/art/<artid>) */
|
|
207
|
-
art: string;
|
|
208
193
|
/** Unknown (media). */
|
|
209
194
|
chapterSource?: string;
|
|
210
195
|
/** Content rating (PG-13; NR; TV-G). */
|
|
211
196
|
contentRating: string;
|
|
212
197
|
/** Duration of episode in milliseconds. */
|
|
213
198
|
duration: number;
|
|
214
|
-
/** Key to this episodes :class:`~plexapi.video.Show` artwork. */
|
|
215
|
-
grandparentArt: string;
|
|
216
199
|
/** Key to this episodes :class:`~plexapi.video.Show`. */
|
|
217
200
|
grandparentKey: string;
|
|
218
201
|
/** Unique key for this episodes :class:`~plexapi.video.Show`. */
|
|
@@ -243,35 +226,12 @@ declare class Episode extends Video {
|
|
|
243
226
|
rating: number;
|
|
244
227
|
/** View offset in milliseconds. */
|
|
245
228
|
viewOffset?: number;
|
|
246
|
-
/** Year episode was released. */
|
|
247
|
-
year: number;
|
|
248
229
|
writers: Writer[];
|
|
249
230
|
directors: Director[];
|
|
250
231
|
media: Media[];
|
|
251
232
|
collections: Collection[];
|
|
252
233
|
chapters: Chapter[];
|
|
253
234
|
markers: Marker[];
|
|
254
|
-
protected _INCLUDES: {
|
|
255
|
-
checkFiles: number;
|
|
256
|
-
includeAllConcerts: number;
|
|
257
|
-
includeBandwidths: number;
|
|
258
|
-
includeChapters: number;
|
|
259
|
-
includeChildren: number;
|
|
260
|
-
includeConcerts: number;
|
|
261
|
-
includeExternalMedia: number;
|
|
262
|
-
includeExtras: number;
|
|
263
|
-
includeFields: string;
|
|
264
|
-
includeGeolocation: number;
|
|
265
|
-
includeLoudnessRamps: number;
|
|
266
|
-
includeMarkers: number;
|
|
267
|
-
includeOnDeck: number;
|
|
268
|
-
includePopularLeaves: number;
|
|
269
|
-
includePreferences: number;
|
|
270
|
-
includeRelated: number;
|
|
271
|
-
includeRelatedCount: number;
|
|
272
|
-
includeReviews: number;
|
|
273
|
-
includeStations: number;
|
|
274
|
-
};
|
|
275
235
|
/**
|
|
276
236
|
* Returns this episodes season number.
|
|
277
237
|
*/
|
|
@@ -284,9 +244,27 @@ declare class Episode extends Video {
|
|
|
284
244
|
* Returns True if this episode has an intro marker
|
|
285
245
|
*/
|
|
286
246
|
hasIntroMarker(): Promise<boolean>;
|
|
247
|
+
/**
|
|
248
|
+
* Returns True if this episode has a credits marker
|
|
249
|
+
*/
|
|
250
|
+
hasCreditsMarker(): Promise<boolean>;
|
|
287
251
|
protected _loadData(data: EpisodeMetadata): void;
|
|
288
252
|
protected _loadFullData(data: {
|
|
289
253
|
Metadata: EpisodeMetadata[];
|
|
290
254
|
}): void;
|
|
291
255
|
}
|
|
256
|
+
export declare class Clip extends Video {
|
|
257
|
+
static TAG: string;
|
|
258
|
+
TYPE: string;
|
|
259
|
+
METADATA_TYPE: string;
|
|
260
|
+
protected _loadData(data: any): void;
|
|
261
|
+
protected _loadFullData(data: any): void;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Represents a single Extra (trailer, behindTheScenes, etc).
|
|
265
|
+
*/
|
|
266
|
+
export declare class Extra extends Clip {
|
|
267
|
+
protected _loadData(data: ExtrasData): void;
|
|
268
|
+
protected _loadFullData(data: any): void;
|
|
269
|
+
}
|
|
292
270
|
export {};
|