Documentation
¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func String(s string) *string
- type Activities
- type Butler
- func (s *Butler) GetButlerTasks(ctx context.Context) (*operations.GetButlerTasksResponse, error)
- func (s *Butler) StartAllTasks(ctx context.Context) (*operations.StartAllTasksResponse, error)
- func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName) (*operations.StartTaskResponse, error)
- func (s *Butler) StopAllTasks(ctx context.Context) (*operations.StopAllTasksResponse, error)
- func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTaskName) (*operations.StopTaskResponse, error)
- type HTTPClient
- type Hubs
- type Library
- func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operations.DeleteLibraryResponse, error)
- func (s *Library) GetCommonLibraryItems(ctx context.Context, sectionID float64, type_ float64, filter *string) (*operations.GetCommonLibraryItemsResponse, error)
- func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64) (*operations.GetFileHashResponse, error)
- func (s *Library) GetLatestLibraryItems(ctx context.Context, sectionID float64, type_ float64, filter *string) (*operations.GetLatestLibraryItemsResponse, error)
- func (s *Library) GetLibraries(ctx context.Context) (*operations.GetLibrariesResponse, error)
- func (s *Library) GetLibrary(ctx context.Context, sectionID float64, ...) (*operations.GetLibraryResponse, error)
- func (s *Library) GetLibraryItems(ctx context.Context, sectionID float64, type_ *float64, filter *string) (*operations.GetLibraryItemsResponse, error)
- func (s *Library) GetMetadata(ctx context.Context, ratingKey float64) (*operations.GetMetadataResponse, error)
- func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64) (*operations.GetMetadataChildrenResponse, error)
- func (s *Library) GetOnDeck(ctx context.Context) (*operations.GetOnDeckResponse, error)
- func (s *Library) GetRecentlyAdded(ctx context.Context) (*operations.GetRecentlyAddedResponse, error)
- func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*operations.RefreshLibraryResponse, error)
- type Log
- func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrailResponse, error)
- func (s *Log) LogLine(ctx context.Context, level operations.Level, message string, source string) (*operations.LogLineResponse, error)
- func (s *Log) LogMultiLine(ctx context.Context) (*operations.LogMultiLineResponse, error)
- type Media
- func (s *Media) MarkPlayed(ctx context.Context, key float64) (*operations.MarkPlayedResponse, error)
- func (s *Media) MarkUnplayed(ctx context.Context, key float64) (*operations.MarkUnplayedResponse, error)
- func (s *Media) UpdatePlayProgress(ctx context.Context, key string, time float64, state string) (*operations.UpdatePlayProgressResponse, error)
- type Playlists
- func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64, uri string, playQueueID float64) (*operations.AddPlaylistContentsResponse, error)
- func (s *Playlists) ClearPlaylistContents(ctx context.Context, playlistID float64) (*operations.ClearPlaylistContentsResponse, error)
- func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.CreatePlaylistRequest) (*operations.CreatePlaylistResponse, error)
- func (s *Playlists) DeletePlaylist(ctx context.Context, playlistID float64) (*operations.DeletePlaylistResponse, error)
- func (s *Playlists) GetPlaylist(ctx context.Context, playlistID float64) (*operations.GetPlaylistResponse, error)
- func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64, type_ float64) (*operations.GetPlaylistContentsResponse, error)
- func (s *Playlists) GetPlaylists(ctx context.Context, playlistType *operations.PlaylistType, ...) (*operations.GetPlaylistsResponse, error)
- func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64) (*operations.UpdatePlaylistResponse, error)
- func (s *Playlists) UploadPlaylist(ctx context.Context, path string, force operations.Force) (*operations.UploadPlaylistResponse, error)
- type PlexAPI
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithIP(ip string) SDKOption
- func WithPort(port string) SDKOption
- func WithProtocol(protocol ServerProtocol) SDKOption
- func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
- func WithSecurity(accessToken string) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- type Search
- func (s *Search) GetSearchResults(ctx context.Context, query string) (*operations.GetSearchResultsResponse, error)
- func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *float64, limit *float64) (*operations.PerformSearchResponse, error)
- func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID *float64, limit *float64) (*operations.PerformVoiceSearchResponse, error)
- type Security
- func (s *Security) GetSourceConnectionInformation(ctx context.Context, source string) (*operations.GetSourceConnectionInformationResponse, error)
- func (s *Security) GetTransientToken(ctx context.Context, type_ operations.QueryParamType, scope operations.Scope) (*operations.GetTransientTokenResponse, error)
- type Server
- func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvailableClientsResponse, error)
- func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse, error)
- func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAccountResponse, error)
- func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResizedPhotoRequest) (*operations.GetResizedPhotoResponse, error)
- func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServerCapabilitiesResponse, error)
- func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerIdentityResponse, error)
- func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListResponse, error)
- func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServerPreferencesResponse, error)
- type ServerProtocol
- type Sessions
- func (s *Sessions) GetSessionHistory(ctx context.Context) (*operations.GetSessionHistoryResponse, error)
- func (s *Sessions) GetSessions(ctx context.Context) (*operations.GetSessionsResponse, error)
- func (s *Sessions) GetTranscodeSessions(ctx context.Context) (*operations.GetTranscodeSessionsResponse, error)
- func (s *Sessions) StopTranscodeSession(ctx context.Context, sessionKey string) (*operations.StopTranscodeSessionResponse, error)
- type Updater
- func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight, skip *operations.Skip) (*operations.ApplyUpdatesResponse, error)
- func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Download) (*operations.CheckForUpdatesResponse, error)
- func (s *Updater) GetUpdateStatus(ctx context.Context) (*operations.GetUpdateStatusResponse, error)
- type Video
Constants ¶
This section is empty.
Variables ¶
var ServerList = []string{
"{protocol}://{ip}:{port}",
}
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type Activities ¶
type Activities struct {
// contains filtered or unexported fields
}
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. - They must contain an `type` which is used by clients to distinguish the specific activity. - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
func (*Activities) CancelServerActivities ¶
func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string) (*operations.CancelServerActivitiesResponse, error)
CancelServerActivities - Cancel Server Activities Cancel Server Activities
func (*Activities) GetServerActivities ¶
func (s *Activities) GetServerActivities(ctx context.Context) (*operations.GetServerActivitiesResponse, error)
GetServerActivities - Get Server Activities Get Server Activities
type Butler ¶
type Butler struct {
// contains filtered or unexported fields
}
Butler is the task manager of the Plex Media Server Ecosystem.
func (*Butler) GetButlerTasks ¶
func (s *Butler) GetButlerTasks(ctx context.Context) (*operations.GetButlerTasksResponse, error)
GetButlerTasks - Get Butler tasks Returns a list of butler tasks
func (*Butler) StartAllTasks ¶
func (s *Butler) StartAllTasks(ctx context.Context) (*operations.StartAllTasksResponse, error)
StartAllTasks - Start all Butler tasks This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: 1. Any tasks not scheduled to run on the current day will be skipped. 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. 4. If we are outside the configured window, the task will start immediately.
func (*Butler) StartTask ¶
func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName) (*operations.StartTaskResponse, error)
StartTask - Start a single Butler task This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: 1. Any tasks not scheduled to run on the current day will be skipped. 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. 4. If we are outside the configured window, the task will start immediately.
func (*Butler) StopAllTasks ¶
func (s *Butler) StopAllTasks(ctx context.Context) (*operations.StopAllTasksResponse, error)
StopAllTasks - Stop all Butler tasks This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
func (*Butler) StopTask ¶
func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTaskName) (*operations.StopTaskResponse, error)
StopTask - Stop a single Butler task This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type Hubs ¶
type Hubs struct {
// contains filtered or unexported fields
}
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
func (*Hubs) GetGlobalHubs ¶
func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient *operations.OnlyTransient) (*operations.GetGlobalHubsResponse, error)
GetGlobalHubs - Get Global Hubs Get Global Hubs filtered by the parameters provided.
func (*Hubs) GetLibraryHubs ¶
func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *float64, onlyTransient *operations.QueryParamOnlyTransient) (*operations.GetLibraryHubsResponse, error)
GetLibraryHubs - Get library specific hubs This endpoint will return a list of library specific hubs
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
Library - API Calls interacting with Plex Media Server Libraries
func (*Library) DeleteLibrary ¶
func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operations.DeleteLibraryResponse, error)
DeleteLibrary - Delete Library Section Delate a library using a specific section
func (*Library) GetCommonLibraryItems ¶
func (s *Library) GetCommonLibraryItems(ctx context.Context, sectionID float64, type_ float64, filter *string) (*operations.GetCommonLibraryItemsResponse, error)
GetCommonLibraryItems - Get Common Library Items Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter
func (*Library) GetFileHash ¶
func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64) (*operations.GetFileHashResponse, error)
GetFileHash - Get Hash Value This resource returns hash values for local files
func (*Library) GetLatestLibraryItems ¶
func (s *Library) GetLatestLibraryItems(ctx context.Context, sectionID float64, type_ float64, filter *string) (*operations.GetLatestLibraryItemsResponse, error)
GetLatestLibraryItems - Get Latest Library Items This endpoint will return a list of the latest library items filtered by the filter and type provided
func (*Library) GetLibraries ¶
func (s *Library) GetLibraries(ctx context.Context) (*operations.GetLibrariesResponse, error)
GetLibraries - Get All Libraries A library section (commonly referred to as just a library) is a collection of media. Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).
func (*Library) GetLibrary ¶
func (s *Library) GetLibrary(ctx context.Context, sectionID float64, includeDetails *operations.IncludeDetails) (*operations.GetLibraryResponse, error)
GetLibrary - Get Library Details Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:
- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:
- Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.
- Secondary: These are marked with `secondary="1"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation.
- Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search="1"` which used to be used to allow clients to build search dialogs on the fly.
- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains:
- `key`: This provides the root endpoint returning the actual media list for the type.
- `type`: This is the metadata type for the type (if a standard Plex type).
- `title`: The title for for the content of this type (e.g. "Movies").
- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.
- `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with.
- `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.
- `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.
- `title`: The title for the filter.
- Each `Sort` object contains a description of the sort field.
- `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).
- `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort.
- `title`: The title of the field.
func (*Library) GetLibraryItems ¶
func (s *Library) GetLibraryItems(ctx context.Context, sectionID float64, type_ *float64, filter *string) (*operations.GetLibraryItemsResponse, error)
GetLibraryItems - Get Library Items This endpoint will return a list of library items filtered by the filter and type provided
func (*Library) GetMetadata ¶
func (s *Library) GetMetadata(ctx context.Context, ratingKey float64) (*operations.GetMetadataResponse, error)
GetMetadata - Get Items Metadata This endpoint will return the metadata of a library item specified with the ratingKey.
func (*Library) GetMetadataChildren ¶
func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64) (*operations.GetMetadataChildrenResponse, error)
GetMetadataChildren - Get Items Children This endpoint will return the children of of a library item specified with the ratingKey.
func (*Library) GetOnDeck ¶
func (s *Library) GetOnDeck(ctx context.Context) (*operations.GetOnDeckResponse, error)
GetOnDeck - Get On Deck This endpoint will return the on deck content.
func (*Library) GetRecentlyAdded ¶
func (s *Library) GetRecentlyAdded(ctx context.Context) (*operations.GetRecentlyAddedResponse, error)
GetRecentlyAdded - Get Recently Added This endpoint will return the recently added content.
func (*Library) RefreshLibrary ¶
func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*operations.RefreshLibraryResponse, error)
RefreshLibrary - Refresh Library This endpoint Refreshes the library.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log - Submit logs to the Log Handler for Plex Media Server
func (*Log) EnablePaperTrail ¶
func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrailResponse, error)
EnablePaperTrail - Enabling Papertrail This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
func (*Log) LogLine ¶
func (s *Log) LogLine(ctx context.Context, level operations.Level, message string, source string) (*operations.LogLineResponse, error)
LogLine - Logging a single line message. This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
func (*Log) LogMultiLine ¶
func (s *Log) LogMultiLine(ctx context.Context) (*operations.LogMultiLineResponse, error)
LogMultiLine - Logging a multi-line message This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.
type Media ¶
type Media struct {
// contains filtered or unexported fields
}
Media - API Calls interacting with Plex Media Server Media
func (*Media) MarkPlayed ¶
func (s *Media) MarkPlayed(ctx context.Context, key float64) (*operations.MarkPlayedResponse, error)
MarkPlayed - Mark Media Played This will mark the provided media key as Played.
func (*Media) MarkUnplayed ¶
func (s *Media) MarkUnplayed(ctx context.Context, key float64) (*operations.MarkUnplayedResponse, error)
MarkUnplayed - Mark Media Unplayed This will mark the provided media key as Unplayed.
func (*Media) UpdatePlayProgress ¶
func (s *Media) UpdatePlayProgress(ctx context.Context, key string, time float64, state string) (*operations.UpdatePlayProgressResponse, error)
UpdatePlayProgress - Update Media Play Progress This API command can be used to update the play progress of a media item.
type Playlists ¶
type Playlists struct {
// contains filtered or unexported fields
}
Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). They can be organized in (optionally nesting) folders. Retrieving a playlist, or its items, will trigger a refresh of its metadata. This may cause the duration and number of items to change.
func (*Playlists) AddPlaylistContents ¶
func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64, uri string, playQueueID float64) (*operations.AddPlaylistContentsResponse, error)
AddPlaylistContents - Adding to a Playlist Adds a generator to a playlist, same parameters as the POST above. With a dumb playlist, this adds the specified items to the playlist. With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
func (*Playlists) ClearPlaylistContents ¶
func (s *Playlists) ClearPlaylistContents(ctx context.Context, playlistID float64) (*operations.ClearPlaylistContentsResponse, error)
ClearPlaylistContents - Delete Playlist Contents Clears a playlist, only works with dumb playlists. Returns the playlist.
func (*Playlists) CreatePlaylist ¶
func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.CreatePlaylistRequest) (*operations.CreatePlaylistResponse, error)
CreatePlaylist - Create a Playlist Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: - `uri` - The content URI for what we're playing (e.g. `library://...`). - `playQueueID` - To create a playlist from an existing play queue.
func (*Playlists) DeletePlaylist ¶
func (s *Playlists) DeletePlaylist(ctx context.Context, playlistID float64) (*operations.DeletePlaylistResponse, error)
DeletePlaylist - Deletes a Playlist This endpoint will delete a playlist
func (*Playlists) GetPlaylist ¶
func (s *Playlists) GetPlaylist(ctx context.Context, playlistID float64) (*operations.GetPlaylistResponse, error)
GetPlaylist - Retrieve Playlist Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
func (*Playlists) GetPlaylistContents ¶
func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64, type_ float64) (*operations.GetPlaylistContentsResponse, error)
GetPlaylistContents - Retrieve Playlist Contents Gets the contents of a playlist. Should be paged by clients via standard mechanisms. By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. For example, you could use this to display a list of recently added albums vis a smart playlist. Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items.
func (*Playlists) GetPlaylists ¶
func (s *Playlists) GetPlaylists(ctx context.Context, playlistType *operations.PlaylistType, smart *operations.QueryParamSmart) (*operations.GetPlaylistsResponse, error)
GetPlaylists - Get All Playlists Get All Playlists given the specified filters.
func (*Playlists) UpdatePlaylist ¶
func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64) (*operations.UpdatePlaylistResponse, error)
UpdatePlaylist - Update a Playlist From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
func (*Playlists) UploadPlaylist ¶
func (s *Playlists) UploadPlaylist(ctx context.Context, path string, force operations.Force) (*operations.UploadPlaylistResponse, error)
UploadPlaylist - Upload Playlist Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
type PlexAPI ¶
type PlexAPI struct { // Operations against the Plex Media Server System. // Server *Server // API Calls interacting with Plex Media Server Media // Media *Media // Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. // Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. // Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: // - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. // - They must contain an `type` which is used by clients to distinguish the specific activity. // - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) // - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. // Activities *Activities // Butler is the task manager of the Plex Media Server Ecosystem. // Butler *Butler // Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. // Hubs *Hubs // API Calls that perform search operations with Plex Media Server // Search *Search // API Calls interacting with Plex Media Server Libraries // Library *Library // Submit logs to the Log Handler for Plex Media Server // Log *Log // Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). // They can be organized in (optionally nesting) folders. // Retrieving a playlist, or its items, will trigger a refresh of its metadata. // This may cause the duration and number of items to change. // Playlists *Playlists // API Calls against Security for Plex Media Server // Security *Security // API Calls that perform search operations with Plex Media Server Sessions // Sessions *Sessions // This describes the API for searching and applying updates to the Plex Media Server. // Updates to the status can be observed via the Event API. // Updater *Updater // API Calls that perform operations with Plex Media Server Videos // Video *Video // contains filtered or unexported fields }
PlexAPI - Plex-API: A Plex Media Server API Map An Open API Spec for interacting with Plex.tv and Plex Servers
type SDKOption ¶
type SDKOption func(*PlexAPI)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithProtocol ¶
func WithProtocol(protocol ServerProtocol) SDKOption
WithProtocol allows setting the protocol variable for url substitution
func WithRetryConfig ¶
func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
func WithSecurity ¶
WithSecurity configures the SDK to use the provided security details
func WithServerIndex ¶
WithServerIndex allows the overriding of the default server by index
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
Search - API Calls that perform search operations with Plex Media Server
func (*Search) GetSearchResults ¶
func (s *Search) GetSearchResults(ctx context.Context, query string) (*operations.GetSearchResultsResponse, error)
GetSearchResults - Get Search Results This will search the database for the string provided.
func (*Search) PerformSearch ¶
func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *float64, limit *float64) (*operations.PerformSearchResponse, error)
PerformSearch - Perform a search This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
- `reason`: The reason for the result, if not because of a direct search term match; can be either:
- `section`: There are multiple identical results from different sections.
- `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language).
- `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor`
- `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
This request is intended to be very fast, and called as the user types.
func (*Search) PerformVoiceSearch ¶
func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID *float64, limit *float64) (*operations.PerformVoiceSearchResponse, error)
PerformVoiceSearch - Perform a voice search This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. Whenever possible, clients should limit the search to the appropriate type. Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
type Security ¶
type Security struct {
// contains filtered or unexported fields
}
Security - API Calls against Security for Plex Media Server
func (*Security) GetSourceConnectionInformation ¶
func (s *Security) GetSourceConnectionInformation(ctx context.Context, source string) (*operations.GetSourceConnectionInformationResponse, error)
GetSourceConnectionInformation - Get Source Connection Information If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. Note: requires Plex Media Server >= 1.15.4.
func (*Security) GetTransientToken ¶
func (s *Security) GetTransientToken(ctx context.Context, type_ operations.QueryParamType, scope operations.Scope) (*operations.GetTransientTokenResponse, error)
GetTransientToken - Get a Transient Token. This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server - Operations against the Plex Media Server System.
func (*Server) GetAvailableClients ¶
func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvailableClientsResponse, error)
GetAvailableClients - Get Available Clients Get Available Clients
func (*Server) GetDevices ¶
func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse, error)
GetDevices - Get Devices Get Devices
func (*Server) GetMyPlexAccount ¶
func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAccountResponse, error)
GetMyPlexAccount - Get MyPlex Account Returns MyPlex Account Information
func (*Server) GetResizedPhoto ¶
func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResizedPhotoRequest) (*operations.GetResizedPhotoResponse, error)
GetResizedPhoto - Get a Resized Photo Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
func (*Server) GetServerCapabilities ¶
func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServerCapabilitiesResponse, error)
GetServerCapabilities - Server Capabilities Server Capabilities
func (*Server) GetServerIdentity ¶
func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerIdentityResponse, error)
GetServerIdentity - Get Server Identity Get Server Identity
func (*Server) GetServerList ¶
func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListResponse, error)
GetServerList - Get Server List Get Server List
func (*Server) GetServerPreferences ¶
func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServerPreferencesResponse, error)
GetServerPreferences - Get Server Preferences Get Server Preferences
type ServerProtocol ¶
type ServerProtocol string
ServerProtocol - The protocol to use when connecting to your plex server.
const ( ServerProtocolHTTP ServerProtocol = "http" ServerProtocolHTTPS ServerProtocol = "https" )
func (ServerProtocol) ToPointer ¶
func (e ServerProtocol) ToPointer() *ServerProtocol
func (*ServerProtocol) UnmarshalJSON ¶
func (e *ServerProtocol) UnmarshalJSON(data []byte) error
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
Sessions - API Calls that perform search operations with Plex Media Server Sessions
func (*Sessions) GetSessionHistory ¶
func (s *Sessions) GetSessionHistory(ctx context.Context) (*operations.GetSessionHistoryResponse, error)
GetSessionHistory - Get Session History This will Retrieve a listing of all history views.
func (*Sessions) GetSessions ¶
func (s *Sessions) GetSessions(ctx context.Context) (*operations.GetSessionsResponse, error)
GetSessions - Get Active Sessions This will retrieve the "Now Playing" Information of the PMS.
func (*Sessions) GetTranscodeSessions ¶
func (s *Sessions) GetTranscodeSessions(ctx context.Context) (*operations.GetTranscodeSessionsResponse, error)
GetTranscodeSessions - Get Transcode Sessions Get Transcode Sessions
func (*Sessions) StopTranscodeSession ¶
func (s *Sessions) StopTranscodeSession(ctx context.Context, sessionKey string) (*operations.StopTranscodeSessionResponse, error)
StopTranscodeSession - Stop a Transcode Session Stop a Transcode Session
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater - This describes the API for searching and applying updates to the Plex Media Server. Updates to the status can be observed via the Event API.
func (*Updater) ApplyUpdates ¶
func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight, skip *operations.Skip) (*operations.ApplyUpdatesResponse, error)
ApplyUpdates - Apply Updates Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
func (*Updater) CheckForUpdates ¶
func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Download) (*operations.CheckForUpdatesResponse, error)
CheckForUpdates - Checking for updates Checking for updates
func (*Updater) GetUpdateStatus ¶
func (s *Updater) GetUpdateStatus(ctx context.Context) (*operations.GetUpdateStatusResponse, error)
GetUpdateStatus - Querying status of updates Querying status of updates
type Video ¶
type Video struct {
// contains filtered or unexported fields
}
Video - API Calls that perform operations with Plex Media Server Videos
func (*Video) GetTimeline ¶
func (s *Video) GetTimeline(ctx context.Context, request operations.GetTimelineRequest) (*operations.GetTimelineResponse, error)
GetTimeline - Get the timeline for a media item Get the timeline for a media item
func (*Video) StartUniversalTranscode ¶
func (s *Video) StartUniversalTranscode(ctx context.Context, request operations.StartUniversalTranscodeRequest) (*operations.StartUniversalTranscodeResponse, error)
StartUniversalTranscode - Start Universal Transcode Begin a Universal Transcode Session