Skip to content

Latest commit

 

History

History
37 lines (35 loc) · 5.41 KB

PlexApi.md

File metadata and controls

37 lines (35 loc) · 5.41 KB

PlexAPI

Function List

Visibility Function (parameters,...): return
public __construct(string $host = '127.0.0.1', mixed/int $port = 32400, bool $ssl = false) : void
Instantiate the class with your Host/Port
public getBaseInfo() : array|bool
Get Plex Server basic info
public getAccount() : array|bool
Get account info
public getLastCallStats() : array
Get last curl stats, for debugging purposes
public getLibrarySections() : array|bool
Get Library Sections ie Movies, TV Shows etc
public getLibrarySectionContents(int $sectionKey, bool $returnCollection = false) : array|ItemCollection|bool
Get Library Section contents
public getMetadata(int $item) : array|bool
Get Metadata for an Item
public getArtwork(Movie $item, string $tag) : string
Get binary data for artwork, can store as jpg at return
public getOnDeck(bool $returnCollection = false) : array|ItemCollection|bool
Get On Deck Info
public getRecentlyAdded(bool $returnCollection = false) : array|ItemCollection|bool
Get Recently Added
public getServers() : array|bool
Get Servers
public getSessions() : array|bool
Get Sessions from Plex
public getToken() : string/bool
Tests the set username and password and returns the auth token
public getTranscodeSessions() : array|bool
Get Transcode Sessions from Plex
public refreshLibrarySection(int $sectionKey, bool $force = false) : null/bool
Refresh a Library Section. This makes Plex search for new and removed items from the Library paths. Doesn't return anything when successful.
public refreshMetadata(int $item, bool $force = false) : null/bool
Refresh a specific item. Doesn't return anything when successful.
public search(string $query, bool $returnCollection = false) : array|ItemCollection|bool
Search for Items
public filter(int $sectionKey, array $filters, bool $returnCollection = false): array|ItemCollection|bool
Filter a library section using common syntax
public setAuth(string $username, string $password) : void
Credentials for logging into Plex.tv. Username can also be an email address.
public setToken(string $token) : void
A valid token for a logged in device, obtainable using setAuth().
public setClientIdentifier(string $identifier) : void
setClientIdentifier
public setDevice(string $name) : void
setDevice
public setDeviceName(string $name) : void
setDeviceName
public setProductName(string $name) : void
setProductName
public setTimeout(int $timeout) : void
setTimeout
protected call(string $path, array $params=array(), string $method = 'GET', bool $isLoginCall = false) : array|bool
Make an API Call or Login Call
private buildHttpQuery(array $query): string
Build http query string from array of Filter objects
protected static normalizeSimpleXML(mixed $obj, mixed $result) : void
normalizeSimpleXML
protected static xml2array(mixed $xml) : mixed
xml2array
public static array2collection(array $array): ItemCollection
public static array2object(array $array): Movie|Show|Season|Episode|Artist|Album|Track