plexgo

package module
v0.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 14 Imported by: 3

README

github.com/LukeHagar/plexgo

Summary

Table of Contents

SDK Installation

To add the SDK as a dependency to your project:

go get github.com/LukeHagar/plexgo

SDK Example Usage

Example
package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.Transcoder.StartTranscodeSession(ctx, operations.StartTranscodeSessionRequest{
		TranscodeType:             components.TranscodeTypeMusic,
		Extension:                 operations.ExtensionMpd,
		AdvancedSubtitles:         components.AdvancedSubtitlesBurn.ToPointer(),
		AudioBoost:                plexgo.Pointer[int64](50),
		AudioChannelCount:         plexgo.Pointer[int64](5),
		AutoAdjustQuality:         components.BoolIntTrue.ToPointer(),
		AutoAdjustSubtitle:        components.BoolIntTrue.ToPointer(),
		DirectPlay:                components.BoolIntTrue.ToPointer(),
		DirectStream:              components.BoolIntTrue.ToPointer(),
		DirectStreamAudio:         components.BoolIntTrue.ToPointer(),
		DisableResolutionRotation: components.BoolIntTrue.ToPointer(),
		HasMDE:                    components.BoolIntTrue.ToPointer(),
		Location:                  operations.StartTranscodeSessionQueryParamLocationWan.ToPointer(),
		MediaBufferSize:           plexgo.Pointer[int64](102400),
		MediaIndex:                plexgo.Pointer[int64](0),
		MusicBitrate:              plexgo.Pointer[int64](5000),
		Offset:                    plexgo.Pointer[float64](90.5),
		PartIndex:                 plexgo.Pointer[int64](0),
		Path:                      plexgo.Pointer("/library/metadata/151671"),
		PeakBitrate:               plexgo.Pointer[int64](12000),
		PhotoResolution:           plexgo.Pointer("1080x1080"),
		Protocol:                  operations.StartTranscodeSessionQueryParamProtocolDash.ToPointer(),
		SecondsPerSegment:         plexgo.Pointer[int64](5),
		SubtitleSize:              plexgo.Pointer[int64](50),
		VideoBitrate:              plexgo.Pointer[int64](12000),
		VideoQuality:              plexgo.Pointer[int64](50),
		VideoResolution:           plexgo.Pointer("1080x1080"),
		XPlexClientProfileExtra:   plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"),
		XPlexClientProfileName:    plexgo.Pointer("generic"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.ResponseStream != nil {
		// handle response
	}
}

Available Resources and Operations

Available methods
Activities
Authentication
Butler
Collections
Content
Devices
DownloadQueue
DVRs
Epg
Events
General
Hubs
Library
LibraryCollections
LibraryPlaylists
LiveTV
Log
  • WriteLog - Logging a multi-line message to the Plex Media Server log
  • WriteMessage - Logging a single-line message to the Plex Media Server log
  • EnablePapertrail - Enabling Papertrail
PlayQueue
Playlist
Plex
Preferences
Provider
Rate
Status
Subscriptions
Timeline
Transcoder
UltraBlur
Updater
Users
  • GetUsers - Get list of all connected users

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retry.Config object to the call by using the WithRetries option:

package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"github.com/LukeHagar/plexgo/retry"
	"log"
	"models/operations"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}, operations.WithRetries(
		retry.Config{
			Strategy: "backoff",
			Backoff: &retry.BackoffStrategy{
				InitialInterval: 1,
				MaxInterval:     50,
				Exponent:        1.1,
				MaxElapsedTime:  100,
			},
			RetryConnectionErrors: false,
		}))
	if err != nil {
		log.Fatal(err)
	}
	if res.MediaContainerWithDirectory != nil {
		// handle response
	}
}

If you'd like to override the default retry strategy for all operations that support retries, you can use the WithRetryConfig option at SDK initialization:

package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"github.com/LukeHagar/plexgo/retry"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithRetryConfig(
			retry.Config{
				Strategy: "backoff",
				Backoff: &retry.BackoffStrategy{
					InitialInterval: 1,
					MaxInterval:     50,
					Exponent:        1.1,
					MaxElapsedTime:  100,
				},
				RetryConnectionErrors: false,
			}),
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{})
	if err != nil {
		log.Fatal(err)
	}
	if res.MediaContainerWithDirectory != nil {
		// handle response
	}
}

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.

By Default, an API error will return sdkerrors.SDKError. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective Errors tables in SDK docs for more details on possible error types for each operation.

For example, the GetTokenDetails function may return the following errors:

Error Type Status Code Content Type
sdkerrors.GetTokenDetailsBadRequest 400 application/json
sdkerrors.GetTokenDetailsUnauthorized 401 application/json
sdkerrors.SDKError 4XX, 5XX */*
Example
package main

import (
	"context"
	"errors"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"github.com/LukeHagar/plexgo/models/sdkerrors"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.Authentication.GetTokenDetails(ctx, operations.GetTokenDetailsRequest{})
	if err != nil {

		var e *sdkerrors.GetTokenDetailsBadRequest
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}

		var e *sdkerrors.GetTokenDetailsUnauthorized
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}

		var e *sdkerrors.SDKError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}
	}
}

Server Selection

Select Server by Index

You can override the default server globally using the WithServerIndex(serverIndex int) option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables Description
0 https://{IP-description}.{identifier}.plex.direct:{port} identifier
IP-description
port
1 {protocol}://{host}:{port} protocol
host
port
2 https://{full_server_url} full_server_url

If the selected server has variables, you may override its default values using the associated option(s):

Variable Option Default Description
identifier WithIdentifier(identifier string) "0123456789abcdef0123456789abcdef" The unique identifier of this particular PMS
IP-description WithIPDescription(ipDescription string) "1-2-3-4" A - separated string of the IPv4 or IPv6 address components
port WithPort(port string) "32400" The Port number configured on the PMS. Typically (32400).
If using a reverse proxy, this would be the port number configured on the proxy.
protocol WithProtocol(protocol string) "http" The network protocol to use. Typically (http or https)
host WithHost(host string) "localhost" The Host of the PMS.
If using on a local network, this is the internal IP address of the server hosting the PMS.
If using on an external network, this is the external IP address for your network, and requires port forwarding.
If using a reverse proxy, this would be the external DNS domain for your network, and requires the proxy handle port forwarding.
full_server_url WithFullServerURL(fullServerURL string) "http://localhost:32400" The full manual URL to access the PMS
Example
package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithServerIndex(0),
		plexgo.WithIdentifier("0123456789abcdef0123456789abcdef"),
		plexgo.WithIPDescription("1-2-3-4"),
		plexgo.WithPort("32400"),
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{})
	if err != nil {
		log.Fatal(err)
	}
	if res.MediaContainerWithDirectory != nil {
		// handle response
	}
}

Override Server URL Per-Client

The default server can also be overridden globally using the WithServerURL(serverURL string) option when initializing the SDK client instance. For example:

package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithServerURL("https://http://localhost:32400"),
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{})
	if err != nil {
		log.Fatal(err)
	}
	if res.MediaContainerWithDirectory != nil {
		// handle response
	}
}

Override Server URL Per-Operation

The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:

package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	res, err := s.Authentication.GetTokenDetails(ctx, operations.GetTokenDetailsRequest{}, operations.WithServerURL("https://plex.tv/api/v2"))
	if err != nil {
		log.Fatal(err)
	}
	if res.UserPlexAccount != nil {
		// handle response
	}
}

Custom HTTP Client

The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

The built-in net/http client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.

import (
	"net/http"
	"time"

	"github.com/LukeHagar/plexgo"
)

var (
	httpClient = &http.Client{Timeout: 30 * time.Second}
	sdkClient  = plexgo.New(plexgo.WithClient(httpClient))
)

This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
Token apiKey API key

You can configure it using the WithSecurity option when initializing the SDK client instance. For example:

package main

import (
	"context"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
	ctx := context.Background()

	s := plexgo.New(
		plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
		plexgo.WithAccepts(components.AcceptsApplicationXML),
		plexgo.WithClientIdentifier("abc123"),
		plexgo.WithProduct("Plex for Roku"),
		plexgo.WithVersion("2.4.1"),
		plexgo.WithPlatform("Roku"),
		plexgo.WithPlatformVersion("4.3 build 1057"),
		plexgo.WithDevice("Roku 3"),
		plexgo.WithModel("4200X"),
		plexgo.WithDeviceVendor("Roku"),
		plexgo.WithDeviceName("Living Room TV"),
		plexgo.WithMarketplace("googlePlay"),
	)

	res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{})
	if err != nil {
		log.Fatal(err)
	}
	if res.MediaContainerWithDirectory != nil {
		// handle response
	}
}

Special Types

This SDK defines the following custom types to assist with marshalling and unmarshalling data.

Date

types.Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".

Usage
d1 := types.NewDate(time.Now()) // returns *types.Date

d2 := types.DateFromTime(time.Now()) // returns types.Date

d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error

d4, err := types.DateFromString("2019-01-01") // returns types.Date, error

d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error

d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = []string{
	"https://{IP-description}.{identifier}.plex.direct:{port}",
	"{protocol}://{host}:{port}",
	"https://{full_server_url}",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer added in v0.11.6

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type Activities

type Activities struct {
	// contains filtered or unexported fields
}

Activities 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.

func (*Activities) CancelActivity added in v0.26.0

CancelActivity - Cancel a running activity Cancel a running activity. Admins can cancel all activities but other users can only cancel their own

func (*Activities) ListActivities added in v0.26.0

func (s *Activities) ListActivities(ctx context.Context, opts ...operations.Option) (*operations.ListActivitiesResponse, error)

ListActivities - Get all activities List all activities on the server. Admins can see all activities but other users can only see their own

type Authentication added in v0.4.1

type Authentication struct {
	// contains filtered or unexported fields
}

func (*Authentication) GetTokenDetails added in v0.11.2

GetTokenDetails - Get Token Details Get the User data from the provided X-Plex-Token

func (*Authentication) PostUsersSignInData added in v0.11.1

PostUsersSignInData - Get User Sign In Data Sign in user with username and password and return user data with Plex authentication token

type Butler

type Butler struct {
	// contains filtered or unexported fields
}

Butler - The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.

func (*Butler) GetTasks added in v0.26.0

func (s *Butler) GetTasks(ctx context.Context, opts ...operations.Option) (*operations.GetTasksResponse, error)

GetTasks - Get all Butler tasks Get the list of butler tasks and their scheduling

func (*Butler) StartTask

StartTask - Start a single Butler task This endpoint will attempt to start a specific Butler task by name.

func (*Butler) StartTasks added in v0.26.0

func (s *Butler) StartTasks(ctx context.Context, opts ...operations.Option) (*operations.StartTasksResponse, error)

StartTasks - 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) StopTask

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

func (*Butler) StopTasks added in v0.26.0

func (s *Butler) StopTasks(ctx context.Context, opts ...operations.Option) (*operations.StopTasksResponse, error)

StopTasks - Stop all Butler tasks This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.

type Collections added in v0.26.0

type Collections struct {
	// contains filtered or unexported fields
}

Collections - API Operations against the Collections

func (*Collections) CreateCollection added in v0.26.0

CreateCollection - Create collection Create a collection in the library

type Content added in v0.26.0

type Content struct {
	// contains filtered or unexported fields
}

Content - The actual content of the media provider

func (*Content) GetAlbums added in v0.26.0

GetAlbums - Set section albums Get all albums in a music section

func (*Content) GetAllLeaves added in v0.26.0

GetAllLeaves - Set section leaves Get all leaves in a section (such as episodes in a show section)

func (*Content) GetArts added in v0.26.0

GetArts - Set section artwork Get artwork for a library section

func (*Content) GetCategories added in v0.26.0

GetCategories - Set section categories Get categories in a library section

func (*Content) GetCluster added in v0.26.0

GetCluster - Set section clusters Get clusters in a library section (typically for photos)

func (*Content) GetCollectionImage added in v0.26.0

GetCollectionImage - Get a collection's image Get an image for the collection based on the items within

func (*Content) GetCollectionItems added in v0.26.0

GetCollectionItems - Get items in a collection Get items in a collection. Note if this collection contains more than 100 items, paging must be used.

func (*Content) GetFolders added in v0.26.0

GetFolders - Get all folder locations Get all folder locations of the media in a section

func (*Content) GetMetadataItem added in v0.26.0

GetMetadataItem - Get a metadata item Get one or more metadata items.

func (*Content) GetSonicPath added in v0.26.0

GetSonicPath - Similar tracks to transition from one to another Get a list of audio tracks starting at one and ending at another which are similar across the path

func (*Content) GetSonicallySimilar added in v0.26.0

GetSonicallySimilar - The nearest audio tracks Get the nearest audio tracks to a particular analysis

func (*Content) ListContent added in v0.26.0

ListContent - Get items in the section Get the items in a section, potentially filtering them

func (*Content) ListMoments added in v0.26.0

ListMoments - Set section moments Get moments in a library section (typically for photos)

type DVRs added in v0.26.0

type DVRs struct {
	// contains filtered or unexported fields
}

DVRs - The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself

func (*DVRs) AddDeviceToDVR added in v0.26.0

AddDeviceToDVR - Add a device to an existing DVR Add a device to an existing DVR

func (*DVRs) AddLineup added in v0.26.0

AddLineup - Add a DVR Lineup Add a lineup to a DVR device's set of lineups.

func (*DVRs) CreateDVR added in v0.26.0

CreateDVR - Create a DVR Creation of a DVR, after creation of a devcie and a lineup is selected

func (*DVRs) DeleteDVR added in v0.26.0

DeleteDVR - Delete a single DVR Delete a single DVR by its id (key)

func (*DVRs) DeleteLineup added in v0.26.0

DeleteLineup - Delete a DVR Lineup Deletes a DVR device's lineup.

func (*DVRs) GetDVR added in v0.26.0

GetDVR - Get a single DVR Get a single DVR by its id (key)

func (*DVRs) ListDVRs added in v0.26.0

func (s *DVRs) ListDVRs(ctx context.Context, opts ...operations.Option) (*operations.ListDVRsResponse, error)

ListDVRs - Get DVRs Get the list of all available DVRs

func (*DVRs) ReloadGuide added in v0.26.0

ReloadGuide - Tell a DVR to reload program guide Tell a DVR to reload program guide

func (*DVRs) RemoveDeviceFromDVR added in v0.26.0

RemoveDeviceFromDVR - Remove a device from an existing DVR Remove a device from an existing DVR

func (*DVRs) SetDVRPreferences added in v0.26.0

SetDVRPreferences - Set DVR preferences Set DVR preferences by name avd value

func (*DVRs) StopDVRReload added in v0.26.0

StopDVRReload - Tell a DVR to stop reloading program guide Tell a DVR to stop reloading program guide

func (*DVRs) TuneChannel added in v0.26.0

TuneChannel - Tune a channel on a DVR Tune a channel on a DVR to the provided channel

type Devices added in v0.26.0

type Devices struct {
	// contains filtered or unexported fields
}

Devices - Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices

Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below.

Example SSDP output ``` <root xmlns="urn:schemas-upnp-org:device-1-0">

<specVersion>
    <major>1</major>
    <minor>0</minor>
</specVersion>
<device>
    <deviceType>urn:plex-tv:device:Media:1</deviceType>
    <friendlyName>Turing Hopper 3000</friendlyName>
    <manufacturer>Plex, Inc.</manufacturer>
    <manufacturerURL>https://plex.tv/</manufacturerURL>
    <modelDescription>Turing Hopper 3000 Media Grabber</modelDescription>
    <modelName>Plex Media Grabber</modelName>
    <modelNumber>1</modelNumber>
    <modelURL>https://plex.tv</modelURL>
    <UDN>uuid:42fde8e4-93b6-41e5-8a63-12d848655811</UDN>
    <serviceList>
        <service>
            <URLBase>http://10.0.0.5:8088</URLBase>
            <serviceType>urn:plex-tv:service:MediaGrabber:1</serviceType>
            <serviceId>urn:plex-tv:serviceId:MediaGrabber</serviceId>
        </service>
    </serviceList>
</device>

</root> ```

  • UDN: (string) A UUID for the device. This should be unique across models of a device at minimum.
  • URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted.

func (*Devices) AddDevice added in v0.26.0

AddDevice - Add a device This endpoint adds a device to an existing grabber. The device is identified, and added to the correct grabber.

func (*Devices) DiscoverDevices added in v0.26.0

func (s *Devices) DiscoverDevices(ctx context.Context, opts ...operations.Option) (*operations.DiscoverDevicesResponse, error)

DiscoverDevices - Tell grabbers to discover devices Tell grabbers to discover devices

func (*Devices) GetAvailableGrabbers added in v0.26.0

GetAvailableGrabbers - Get available grabbers Get available grabbers visible to the server

func (*Devices) GetDeviceDetails added in v0.26.0

GetDeviceDetails - Get device details Get a device's details by its id

func (*Devices) GetDevicesChannels added in v0.26.0

GetDevicesChannels - Get a device's channels Get a device's channels by its id

func (*Devices) GetThumb added in v0.26.0

GetThumb - Get device thumb Get a device's thumb for display to the user

func (*Devices) ListDevices added in v0.26.0

func (s *Devices) ListDevices(ctx context.Context, opts ...operations.Option) (*operations.ListDevicesResponse, error)

ListDevices - Get all devices Get the list of all devices present

func (*Devices) ModifyDevice added in v0.26.0

ModifyDevice - Enable or disable a device Enable or disable a device by its id

func (*Devices) RemoveDevice added in v0.26.0

RemoveDevice - Remove a device Remove a devices by its id along with its channel mappings

func (*Devices) Scan added in v0.26.0

Scan - Tell a device to scan for channels Tell a device to scan for channels

func (*Devices) SetChannelmap added in v0.26.0

SetChannelmap - Set a device's channel mapping Set a device's channel mapping

func (*Devices) SetDevicePreferences added in v0.26.0

SetDevicePreferences - Set device preferences Set device preferences by its id

func (*Devices) StopScan added in v0.26.0

StopScan - Tell a device to stop scanning for channels Tell a device to stop scanning for channels

type DownloadQueue added in v0.26.0

type DownloadQueue struct {
	// contains filtered or unexported fields
}

DownloadQueue - API Operations against the Download Queue

func (*DownloadQueue) AddDownloadQueueItems added in v0.26.0

AddDownloadQueueItems - Add to download queue Available: 0.2.0

Add items to the download queue

func (*DownloadQueue) CreateDownloadQueue added in v0.26.0

func (s *DownloadQueue) CreateDownloadQueue(ctx context.Context, opts ...operations.Option) (*operations.CreateDownloadQueueResponse, error)

CreateDownloadQueue - Create download queue 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.

func (*DownloadQueue) GetDownloadQueue added in v0.26.0

GetDownloadQueue - Get a download queue Available: 0.2.0

Get a download queue by its id

func (*DownloadQueue) GetDownloadQueueItems added in v0.26.0

GetDownloadQueueItems - Get download queue items Available: 0.2.0

Get items from a download queue

func (*DownloadQueue) GetDownloadQueueMedia added in v0.26.0

GetDownloadQueueMedia - Grab download queue media Available: 0.2.0

Grab the media for a download queue item

func (*DownloadQueue) GetItemDecision added in v0.26.0

GetItemDecision - Grab download queue item decision Available: 0.2.0

Grab the decision for a download queue item

func (*DownloadQueue) ListDownloadQueueItems added in v0.26.0

ListDownloadQueueItems - Get download queue items Available: 0.2.0

Get items from a download queue

func (*DownloadQueue) RemoveDownloadQueueItems added in v0.26.0

RemoveDownloadQueueItems - Delete download queue items delete items from a download queue

func (*DownloadQueue) RestartProcessingDownloadQueueItems added in v0.26.0

RestartProcessingDownloadQueueItems - Restart processing of items from the decision Available: 0.2.0

Reprocess download queue items with previous decision parameters

type Epg added in v0.26.0

type Epg struct {
	// contains filtered or unexported fields
}

Epg - The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when

func (*Epg) ComputeChannelMap added in v0.26.0

ComputeChannelMap - Compute the best channel map Compute the best channel map, given device and lineup

func (*Epg) GetAllLanguages added in v0.26.0

func (s *Epg) GetAllLanguages(ctx context.Context, opts ...operations.Option) (*operations.GetAllLanguagesResponse, error)

GetAllLanguages - Get all languages Returns a list of all possible languages for EPG data.

func (*Epg) GetChannels added in v0.26.0

GetChannels - Get channels for a lineup Get channels for a lineup within an EPG provider

func (*Epg) GetCountries added in v0.26.0

func (s *Epg) GetCountries(ctx context.Context, opts ...operations.Option) (*operations.GetCountriesResponse, error)

GetCountries - Get all countries This endpoint returns a list of countries which EPG data is available for. There are three flavors, as specfied by the `flavor` attribute

func (*Epg) GetCountriesLineups added in v0.26.0

GetCountriesLineups - Get lineups for a country via postal code Returns a list of lineups for a given country, EPG provider and postal code

func (*Epg) GetCountryRegions added in v0.26.0

GetCountryRegions - Get regions for a country Get regions for a country within an EPG provider

func (*Epg) GetLineup added in v0.26.0

GetLineup - Compute the best lineup Compute the best lineup, given lineup group and device

func (*Epg) GetLineupChannels added in v0.26.0

GetLineupChannels - Get the channels for mulitple lineups Get the channels across multiple lineups

func (*Epg) ListLineups added in v0.26.0

ListLineups - Get lineups for a region Get lineups for a region within an EPG provider

type Events added in v0.26.0

type Events struct {
	// contains filtered or unexported fields
}

Events - The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported.

Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket.

func (*Events) ConnectWebSocket added in v0.26.0

ConnectWebSocket - Connect to WebSocket Connect to the web socket to get a stream of events

func (*Events) GetNotifications added in v0.26.0

GetNotifications - Connect to Eventsource Connect to the event source to get a stream of events

type General added in v0.26.0

type General struct {
	// contains filtered or unexported fields
}

General endpoints for basic PMS operation not specific to any media provider

func (*General) GetIdentity added in v0.26.0

func (s *General) GetIdentity(ctx context.Context, opts ...operations.Option) (*operations.GetIdentityResponse, error)

GetIdentity - Get PMS identity Get details about this PMS's identity

func (*General) GetServerInfo added in v0.26.0

GetServerInfo - Get PMS info Information about this PMS setup and configuration

func (*General) GetSourceConnectionInformation added in v0.26.0

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.

func (*General) GetTransientToken added in v0.26.0

GetTransientToken - Get Transient Tokens 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. Note: This endpoint responds to all HTTP verbs but POST in preferred

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for supplying the SDK with a custom HTTP client

type Hubs

type Hubs struct {
	// contains filtered or unexported fields
}

Hubs - The hubs within a media provider

func (*Hubs) CreateCustomHub added in v0.26.0

CreateCustomHub - Create a custom hub Create a custom hub based on a metadata item

func (*Hubs) DeleteCustomHub added in v0.26.0

DeleteCustomHub - Delete a custom hub Delete a custom hub from the server

func (*Hubs) GetAllHubs added in v0.26.0

GetAllHubs - Get global hubs Get the global hubs in this PMS

func (*Hubs) GetContinueWatching added in v0.26.0

GetContinueWatching - Get the continue watching hub Get the global continue watching hub

func (*Hubs) GetHubItems added in v0.26.0

GetHubItems - Get a hub's items Get the items within a single hub specified by identifier

func (*Hubs) GetMetadataHubs added in v0.26.0

GetMetadataHubs - Get hubs for section by metadata item Get the hubs for a section by metadata item. Currently only for music sections

func (*Hubs) GetPostplayHubs added in v0.26.0

GetPostplayHubs - Get postplay hubs Get the hubs for a metadata to be displayed in post play

func (*Hubs) GetPromotedHubs added in v0.26.0

GetPromotedHubs - Get the hubs which are promoted Get the global hubs which are promoted (should be displayed on the home screen)

func (*Hubs) GetRelatedHubs added in v0.26.0

GetRelatedHubs - Get related hubs Get the hubs for a metadata related to the provided metadata item

func (*Hubs) GetSectionHubs added in v0.26.0

GetSectionHubs - Get section hubs Get the hubs for a single section

func (*Hubs) ListHubs added in v0.26.0

ListHubs - Get hubs Get the list of hubs including both built-in and custom

func (*Hubs) MoveHub added in v0.26.0

MoveHub - Move Hub Changed the ordering of a hub among others hubs

func (*Hubs) ResetSectionDefaults added in v0.26.0

ResetSectionDefaults - Reset hubs to defaults Reset hubs for this section to defaults and delete custom hubs

func (*Hubs) UpdateHubVisibility added in v0.26.0

UpdateHubVisibility - Change hub visibility Changed the visibility of a hub for both the admin and shared users

type Library

type Library struct {
	// contains filtered or unexported fields
}

Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc).

func (*Library) AddExtras added in v0.26.0

AddExtras - Add to an item's extras Add an extra to a metadata item

func (*Library) AddSection added in v0.26.0

AddSection - Add a library section Add a new library section to the server

func (*Library) AddSubtitles added in v0.26.0

AddSubtitles - Add subtitles Add a subtitle to a metadata item

func (*Library) AnalyzeMetadata added in v0.26.0

AnalyzeMetadata - Analyze an item Start the analysis of a metadata item

func (*Library) Autocomplete added in v0.26.0

Autocomplete - Get autocompletions for search The field to autocomplete on is specified by the `{field}.query` parameter. For example `genre.query` or `title.query`. Returns a set of items from the filtered items whose `{field}` starts with `{field}.query`. In the results, a `{field}.queryRange` will be present to express the range of the match

func (*Library) CancelRefresh added in v0.26.0

CancelRefresh - Cancel section refresh Cancel the refresh of a section

func (*Library) CleanBundles added in v0.26.0

func (s *Library) CleanBundles(ctx context.Context, opts ...operations.Option) (*operations.CleanBundlesResponse, error)

CleanBundles - Clean bundles Clean out any now unused bundles. Bundles can become unused when media is deleted

func (*Library) CreateMarker added in v0.26.0

CreateMarker - Create a marker Create a marker for this user on the metadata item

func (*Library) DeleteCaches added in v0.26.0

func (s *Library) DeleteCaches(ctx context.Context, opts ...operations.Option) (*operations.DeleteCachesResponse, error)

DeleteCaches - Delete library caches Delete the hub caches so they are recomputed on next request

func (*Library) DeleteCollection added in v0.26.0

DeleteCollection - Delete a collection Delete a library collection from the PMS

func (*Library) DeleteIndexes added in v0.26.0

DeleteIndexes - Delete section indexes Delete all the indexes in a section

func (*Library) DeleteIntros added in v0.26.0

DeleteIntros - Delete section intro markers Delete all the intro markers in a section

func (*Library) DeleteLibrarySection added in v0.26.0

DeleteLibrarySection - Delete a library section Delete a library section by id

func (*Library) DeleteMarker added in v0.26.0

DeleteMarker - Delete a marker Delete a marker for this user on the metadata item

func (*Library) DeleteMediaItem added in v0.26.0

DeleteMediaItem - Delete a media item Delete a single media from a metadata item in the library

func (*Library) DeleteMetadataItem added in v0.26.0

DeleteMetadataItem - Delete a metadata item Delete a single metadata item from the library, deleting media as well

func (*Library) DeleteStream added in v0.26.0

DeleteStream - Delete a stream Delete a stream. Only applies to downloaded subtitle streams or a sidecar subtitle when media deletion is enabled.

func (*Library) DetectAds added in v0.26.0

DetectAds - Ad-detect an item Start the detection of ads in a metadata item

func (*Library) DetectCredits added in v0.26.0

DetectCredits - Credit detect a metadata item Start credit detection on a metadata item

func (*Library) DetectIntros added in v0.26.0

DetectIntros - Intro detect an item Start the detection of intros in a metadata item

func (*Library) DetectVoiceActivity added in v0.26.0

DetectVoiceActivity - Detect voice activity Start the detection of voice in a metadata item

func (*Library) EditMarker added in v0.26.0

EditMarker - Edit a marker Edit a marker for this user on the metadata item

func (*Library) EditMetadataItem added in v0.26.0

EditMetadataItem - Edit a metadata item Edit metadata items setting fields

func (*Library) EditSection added in v0.26.0

EditSection - Edit a library section Edit a library section by id setting parameters

func (*Library) EmptyTrash added in v0.26.0

EmptyTrash - Empty section trash Empty trash in the section, permanently deleting media/metadata for missing media

func (*Library) GenerateThumbs added in v0.26.0

GenerateThumbs - Generate thumbs of chapters for an item Start the chapter thumb generation for an item

func (*Library) GetAllItemLeaves added in v0.26.0

GetAllItemLeaves - Get the leaves of an item Get the leaves for a metadata item such as the episodes in a show

func (*Library) GetAugmentationStatus added in v0.26.0

GetAugmentationStatus - Get augmentation status Get augmentation status and potentially wait for completion

func (*Library) GetAvailableSorts added in v0.26.0

GetAvailableSorts - Get a section sorts Get the sort mechanisms available in a section

func (*Library) GetChapterImage added in v0.26.0

GetChapterImage - Get a chapter image Get a single chapter image for a piece of media

func (*Library) GetCollections added in v0.26.0

GetCollections - Get collections in a section Get all collections in a section

func (*Library) GetCommon added in v0.26.0

GetCommon - Get common fields for items Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter Fields which are not common will be expressed in the `mixedFields` field

func (*Library) GetExtras added in v0.26.0

GetExtras - Get an item's extras Get the extras for a metadata item

func (*Library) GetFile added in v0.26.0

GetFile - Get a file from a metadata or media bundle Get a bundle file for a metadata or media item. This is either an image or a mp3 (for a show's theme)

func (*Library) GetFirstCharacters added in v0.26.0

GetFirstCharacters - Get list of first characters Get list of first characters in this section

func (*Library) GetImageFromBif added in v0.26.0

GetImageFromBif - Get an image from part BIF Extract an image from the BIF for a part at a particular offset

func (*Library) GetItemArtwork added in v0.26.0

GetItemArtwork - Get an item's artwork, theme, etc Get the artwork, thumb, element for a metadata item

func (*Library) GetItemTree added in v0.26.0

GetItemTree - Get metadata items as a tree Get a tree of metadata items, such as the seasons/episodes of a show

func (*Library) GetLibraryDetails added in v0.11.1

GetLibraryDetails - Get a library section by id 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. It often contains a list of `Directory` metadata objects: These used to be used by clients to build a menuing system.

func (*Library) GetLibraryItems

GetLibraryItems - Get all items in library Request all metadata items according to a query.

func (*Library) GetLibraryMatches added in v0.26.0

GetLibraryMatches - Get library matches The matches endpoint is used to match content external to the library with content inside the library. This is done by passing a series of semantic "hints" about the content (its type, name, or release year). Each type (e.g. movie) has a canonical set of minimal required hints. This ability to match content is useful in a variety of scenarios. For example, in the DVR, the EPG uses the endpoint to match recording rules against airing content. And in the cloud, the UMP uses the endpoint to match up a piece of media with rich metadata. The endpoint response can including multiple matches, if there is ambiguity, each one containing a `score` from 0 to 100. For somewhat historical reasons, anything over 85 is considered a positive match (we prefer false negatives over false positives in general for matching). The `guid` hint is somewhat special, in that it generally represents a unique identity for a piece of media (e.g. the IMDB `ttXXX`) identifier, in contrast with other hints which can be much more ambiguous (e.g. a title of `Jane Eyre`, which could refer to the 1943 or the 2011 version). Episodes require either a season/episode pair, or an air date (or both). Either the path must be sent, or the show title

func (*Library) GetMediaPart added in v0.26.0

GetMediaPart - Get a media part Get a media part for streaming or download.

  • streaming: This is the default scenario. Bandwidth usage on this endpoint will be guaranteed (on the server's end) to be at least the bandwidth reservation given in the decision. If no decision exists, an ad-hoc decision will be created if sufficient bandwidth exists. Clients should not rely on ad-hoc decisions being made as this may be removed in the future.
  • download: Indicated if the query parameter indicates this is a download. Bandwidth will be prioritized behind playbacks and will get a fair share of what remains.

func (*Library) GetPartIndex added in v0.26.0

GetPartIndex - Get BIF index for a part Get BIF index for a part by index type

func (*Library) GetPerson added in v0.26.0

GetPerson - Get person details Get details for a single actor.

func (*Library) GetRandomArtwork added in v0.26.0

GetRandomArtwork - Get random artwork Get random artwork across sections. This is commonly used for a screensaver.

This retrieves 100 random artwork paths in the specified sections and returns them. Restrictions are put in place to not return artwork for items the user is not allowed to access. Artwork will be for Movies, Shows, and Artists only.

func (*Library) GetRelatedItems added in v0.26.0

GetRelatedItems - Get related items Get a hub of related items to a metadata item

func (*Library) GetSectionFilters added in v0.26.0

GetSectionFilters - Get section filters Get common filters on a section

func (*Library) GetSectionImage added in v0.26.0

GetSectionImage - Get a section composite image Get a composite image of images in this section

func (*Library) GetSectionPreferences added in v0.26.0

GetSectionPreferences - Get section prefs Get the prefs for a section by id and potentially overriding the agent

func (*Library) GetSections added in v0.26.0

func (s *Library) GetSections(ctx context.Context, opts ...operations.Option) (*operations.GetSectionsResponse, error)

GetSections - Get library sections (main Media Provider Only) 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) GetSectionsPrefs added in v0.26.0

GetSectionsPrefs - Get section prefs Get a section's preferences for a metadata type

func (*Library) GetStream added in v0.26.0

GetStream - Get a stream Get a stream (such as a sidecar subtitle stream)

func (*Library) GetStreamLevels added in v0.26.0

GetStreamLevels - Get loudness about a stream in json The the loudness of a stream in db, one entry per 100ms

func (*Library) GetStreamLoudness added in v0.26.0

GetStreamLoudness - Get loudness about a stream The the loudness of a stream in db, one number per line, one entry per 100ms

func (*Library) GetTags added in v0.26.0

GetTags - Get all library tags of a type Get all library tags of a type

func (*Library) IngestTransientItem added in v0.26.0

IngestTransientItem - Ingest a transient item This endpoint takes a file path specified in the `url` parameter, matches it using the scanner's match mechanism, downloads rich metadata, and then ingests the item as a transient item (without a library section). In the case where the file represents an episode, the entire tree (show, season, and episode) is added as transient items. At this time, movies and episodes are the only supported types, which are gleaned automatically from the file path. Note that any of the parameters passed to the metadata details endpoint (e.g. `includeExtras=1`) work here.

func (*Library) ListMatches added in v0.26.0

ListMatches - Get metadata matches for an item Get the list of metadata matches for a metadata item

func (*Library) ListPersonMedia added in v0.26.0

ListPersonMedia - Get media for a person Get all the media for a single actor.

func (*Library) ListSimilar added in v0.26.0

ListSimilar - Get similar items Get a list of similar items to a metadata item

func (*Library) ListSonicallySimilar added in v0.26.0

ListSonicallySimilar - Get nearest tracks to metadata item Get the nearest tracks, sonically, to the provided track

func (*Library) ListTopUsers added in v0.26.0

ListTopUsers - Get metadata top users Get the list of users which have played this item starting with the most

func (*Library) MatchItem added in v0.26.0

MatchItem - Match a metadata item Match a metadata item to a guid

func (*Library) MergeItems added in v0.26.0

MergeItems - Merge a metadata item Merge a metadata item with other items

func (*Library) OptimizeDatabase added in v0.26.0

OptimizeDatabase - Optimize the Database Initiate optimize on the database.

func (*Library) RefreshItemsMetadata added in v0.26.0

RefreshItemsMetadata - Refresh a metadata item Refresh a metadata item from the agent

func (*Library) RefreshSection added in v0.26.0

RefreshSection - Refresh section Start a refresh of this section

func (*Library) RefreshSectionsMetadata added in v0.26.0

RefreshSectionsMetadata - Refresh all sections Tell PMS to refresh all section metadata

func (*Library) SetItemArtwork added in v0.26.0

SetItemArtwork - Set an item's artwork, theme, etc Set the artwork, thumb, element for a metadata item Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user

func (*Library) SetItemPreferences added in v0.26.0

SetItemPreferences - Set metadata preferences Set the preferences on a metadata item

func (*Library) SetSectionPreferences added in v0.26.0

SetSectionPreferences - Set section prefs Set the prefs for a section by id

func (*Library) SetStreamOffset added in v0.26.0

SetStreamOffset - Set a stream offset Set a stream offset in ms. This may not be respected by all clients

func (*Library) SetStreamSelection added in v0.26.0

SetStreamSelection - Set stream selection Set which streams (audio/subtitle) are selected by this user

func (*Library) SplitItem added in v0.26.0

SplitItem - Split a metadata item Split a metadata item into multiple items

func (*Library) StartAnalysis added in v0.26.0

StartAnalysis - Analyze a section Start analysis of all items in a section. If BIF generation is enabled, this will also be started on this section

func (*Library) StartBifGeneration added in v0.26.0

StartBifGeneration - Start BIF generation of an item Start the indexing (BIF generation) of an item

func (*Library) StopAllRefreshes added in v0.26.0

func (s *Library) StopAllRefreshes(ctx context.Context, opts ...operations.Option) (*operations.StopAllRefreshesResponse, error)

StopAllRefreshes - Stop refresh Stop all refreshes across all sections

func (*Library) Unmatch added in v0.26.0

Unmatch a metadata item Unmatch a metadata item to info fetched from the agent

func (*Library) UpdateItemArtwork added in v0.26.0

UpdateItemArtwork - Set an item's artwork, theme, etc Set the artwork, thumb, element for a metadata item Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user

func (*Library) UpdateItems added in v0.26.0

UpdateItems - Set the fields of the filtered items This endpoint takes an large possible set of values. Here are some examples. - **Parameters, extra documentation**

  • artist.title.value
  • When used with track, both artist.title.value and album.title.value need to be specified
  • title.value usage
  • Summary
  • Tracks always rename and never merge
  • Albums and Artists
  • if single item and item without title does not exist, it is renamed.
  • if single item and item with title does exist they are merged.
  • if multiple they are always merged.
  • Tracks
  • Works as expected will update the track's title
  • Single track: `/library/sections/{id}/all?type=10&id=42&title.value=NewName`
  • Multiple tracks: `/library/sections/{id}/all?type=10&id=42,43,44&title.value=NewName`
  • All tracks: `/library/sections/{id}/all?type=10&title.value=NewName`
  • Albums
  • Functionality changes depending on the existence of an album with the same title
  • Album exists
  • Single album: `/library/sections/{id}/all?type=9&id=42&title.value=Album 2`
  • Album with id 42 is merged into album titled "Album 2"
  • Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=Moo Album`
  • All albums are merged into the existing album titled "Moo Album"
  • Album does not exist
  • Single album: `/library/sections/{id}/all?type=9&id=42&title.value=NewAlbumTitle`
  • Album with id 42 has title modified to "NewAlbumTitle"
  • Multiple/All albums: `/library/sections/{id}/all?type=9&title.value=NewAlbumTitle`
  • All albums are merged into a new album with title="NewAlbumTitle"
  • Artists
  • Functionaly changes depending on the existence of an artist with the same title.
  • Artist exists
  • Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=Artist 2`
  • Artist with id 42 is merged into existing artist titled "Artist 2"
  • Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=Artist 3`
  • All artists are merged into the existing artist titled "Artist 3"
  • Artist does not exist
  • Single artist: `/library/sections/{id}/all?type=8&id=42&title.value=NewArtistTitle`
  • Artist with id 42 has title modified to "NewArtistTitle"
  • Multiple/All artists: `/library/sections/{id}/all?type=8&title.value=NewArtistTitle`
  • All artists are merged into a new artist with title="NewArtistTitle"

- **Notes**

  • Technically square brackets are not allowed in an URI except the Internet Protocol Literal Address
  • RFC3513: A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax.
  • Escaped square brackets are allowed, but don't render well

type LibraryCollections added in v0.26.0

type LibraryCollections struct {
	// contains filtered or unexported fields
}

LibraryCollections - Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well.

func (*LibraryCollections) AddCollectionItems added in v0.26.0

AddCollectionItems - Add items to a collection Add items to a collection by uri

func (*LibraryCollections) DeleteCollectionItem added in v0.26.0

DeleteCollectionItem - Delete an item from a collection Delete an item from a collection

func (*LibraryCollections) MoveCollectionItem added in v0.26.0

MoveCollectionItem - Reorder an item in the collection Reorder items in a collection with one item after another

type LibraryPlaylists added in v0.26.0

type LibraryPlaylists struct {
	// contains filtered or unexported fields
}

LibraryPlaylists - Endpoints for manipulating playlists.

func (*LibraryPlaylists) AddPlaylistItems added in v0.26.0

AddPlaylistItems - 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 (*LibraryPlaylists) ClearPlaylistItems added in v0.26.0

ClearPlaylistItems - Clearing a playlist Clears a playlist, only works with dumb playlists. Returns the playlist.

func (*LibraryPlaylists) CreatePlaylist added in v0.26.0

CreatePlaylist - Create a Playlist Create a new playlist. By default the playlist is blank.

func (*LibraryPlaylists) DeletePlaylist added in v0.26.0

DeletePlaylist - Delete a Playlist Deletes a playlist by provided id

func (*LibraryPlaylists) DeletePlaylistItem added in v0.26.0

DeletePlaylistItem - Delete a Generator Deletes an item from a playlist. Only works with dumb playlists.

func (*LibraryPlaylists) GetPlaylistGenerator added in v0.26.0

GetPlaylistGenerator - Get a playlist generator Get a playlist's generator. Only used for optimized versions

func (*LibraryPlaylists) GetPlaylistGeneratorItems added in v0.26.0

GetPlaylistGeneratorItems - Get a playlist generator's items Get a playlist generator's items

func (*LibraryPlaylists) GetPlaylistGenerators added in v0.26.0

GetPlaylistGenerators - Get a playlist's generators Get all the generators in a playlist

func (*LibraryPlaylists) ModifyPlaylistGenerator added in v0.26.0

ModifyPlaylistGenerator - Modify a Generator Modify a playlist generator. Only used for optimizer

func (*LibraryPlaylists) MovePlaylistItem added in v0.26.0

MovePlaylistItem - Moving items in a playlist Moves an item in a playlist. Only works with dumb playlists.

func (*LibraryPlaylists) RefreshPlaylist added in v0.26.0

RefreshPlaylist - Reprocess a generator Make a generator reprocess (refresh)

func (*LibraryPlaylists) UpdatePlaylist added in v0.26.0

UpdatePlaylist - Editing a Playlist Edits a playlist in the same manner as [editing metadata](#tag/Provider/operation/metadataPutItem)

func (*LibraryPlaylists) UploadPlaylist added in v0.26.0

UploadPlaylist - Upload 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 LiveTV added in v0.26.0

type LiveTV struct {
	// contains filtered or unexported fields
}

LiveTV contains the playback sessions of a channel from a DVR device

func (*LiveTV) GetLiveTVSession added in v0.26.0

GetLiveTVSession - Get a single session Get a single livetv session and metadata

func (*LiveTV) GetSessionPlaylistIndex added in v0.26.0

GetSessionPlaylistIndex - Get a session playlist index Get a playlist index for playing this session

func (*LiveTV) GetSessionSegment added in v0.26.0

GetSessionSegment - Get a single session segment Get a single LiveTV session segment

func (*LiveTV) GetSessions added in v0.26.0

func (s *LiveTV) GetSessions(ctx context.Context, opts ...operations.Option) (*operations.GetSessionsResponse, error)

GetSessions - Get all sessions Get all livetv sessions and metadata

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log - Logging mechanism to allow clients to log to the server

func (*Log) EnablePapertrail added in v0.26.0

EnablePapertrail - Enabling Papertrail This endpoint will enable all Plex Media Server logs to be sent to the Papertrail networked logging site for a period of time

Note: This endpoint responds to all HTTP verbs but POST is preferred

func (*Log) WriteLog added in v0.26.0

func (s *Log) WriteLog(ctx context.Context, request any, opts ...operations.Option) (*operations.WriteLogResponse, error)

WriteLog - Logging a multi-line message to the Plex Media Server log 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 PUT endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.

func (*Log) WriteMessage added in v0.26.0

WriteMessage - Logging a single-line message to the Plex Media Server log This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.

Note: This endpoint responds to all HTTP verbs **except POST** but PUT is preferred

type PlayQueue added in v0.26.0

type PlayQueue struct {
	// contains filtered or unexported fields
}

PlayQueue - The playqueue feature within a media provider A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue. Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed. You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion. All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area. The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item.

func (*PlayQueue) AddToPlayQueue added in v0.26.0

AddToPlayQueue - Add a generator or playlist to a play queue Adds an item to a play queue (e.g. party mode). Increments the version of the play queue. Takes the following parameters (`uri` and `playlistID` are mutually exclusive). Returns the modified play queue.

func (*PlayQueue) ClearPlayQueue added in v0.26.0

ClearPlayQueue - Clear a play queue Deletes all items in the play queue, and increases the version of the play queue.

func (*PlayQueue) CreatePlayQueue added in v0.26.0

CreatePlayQueue - Create a play queue Makes a new play queue for a device. The source of the playqueue can either be a URI, or a playlist. The response is a media container with the initial items in the queue. Each item in the queue will be a regular item but with `playQueueItemID` - a unique ID since the queue could have repeated items with the same `ratingKey`. Note: Either `uri` or `playlistID` must be specified

func (*PlayQueue) DeletePlayQueueItem added in v0.26.0

DeletePlayQueueItem - Delete an item from a play queue Deletes an item in a play queue. Increments the version of the play queue. Returns the modified play queue.

func (*PlayQueue) GetPlayQueue added in v0.26.0

GetPlayQueue - Retrieve a play queue Retrieves the play queue, centered at current item. This can be treated as a regular container by play queue-oblivious clients, but they may wish to request a large window onto the queue since they won't know to refresh.

func (*PlayQueue) MovePlayQueueItem added in v0.26.0

MovePlayQueueItem - Move an item in a play queue Moves an item in a play queue, and increases the version of the play queue. Returns the modified play queue.

func (*PlayQueue) ResetPlayQueue added in v0.26.0

ResetPlayQueue - Reset a play queue Reset a play queue to the first item being the current item

func (*PlayQueue) Shuffle added in v0.26.0

Shuffle a play queue Shuffle a play queue (or reshuffles if already shuffled). The currently selected item is maintained. Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue.

func (*PlayQueue) Unshuffle added in v0.26.0

Unshuffle a play queue Unshuffles a play queue and restores "natural order". Note that this is currently only supported for play queues *without* an Up Next area. Returns the modified play queue.

type Playlist added in v0.26.0

type Playlist struct {
	// contains filtered or unexported fields
}

Playlist - Media playlists that can be created and played back

func (*Playlist) GetPlaylist added in v0.26.0

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 (*Playlist) GetPlaylistItems added in v0.26.0

GetPlaylistItems - 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 (*Playlist) ListPlaylists added in v0.26.0

ListPlaylists - List playlists Gets a list of playlists and playlist folders for a user. General filters are permitted, such as `sort=lastViewedAt:desc`. A flat playlist list can be retrieved using `type=15` to limit the collection to just playlists.

type Plex added in v0.2.0

type Plex struct {
	// contains filtered or unexported fields
}

func (*Plex) GetServerResources added in v0.11.1

GetServerResources - Get Server Resources Get Plex server access tokens and server connections

type PlexAPI

type PlexAPI struct {
	SDKVersion string
	// General endpoints for basic PMS operation not specific to any media provider
	General *General
	// The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported.
	//
	// Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket.
	//
	Events *Events
	// API Operations against the Preferences
	Preferences *Preferences
	// Operations for rating media items (thumbs up/down, star ratings, etc.)
	Rate *Rate
	// The actions feature within a media provider
	Timeline *Timeline
	// Activities 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.
	//
	Activities *Activities
	// The butler is responsible for running periodic tasks.  Some tasks run daily, others every few days, and some weekly.  These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.
	Butler *Butler
	// API Operations against the Download Queue
	DownloadQueue *DownloadQueue
	// The hubs within a media provider
	Hubs *Hubs
	// The search feature within a media provider
	Search *Search
	// Library endpoints which are outside of the Media Provider API.  Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc).
	Library *Library
	// API Operations against the Collections
	Collections *Collections
	// The DVR provides means to watch and record live TV.  This section of endpoints describes how to setup the DVR itself
	//
	DVRs *DVRs
	// The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when
	//
	Epg *Epg
	// LiveTV contains the playback sessions of a channel from a DVR device
	//
	LiveTV *LiveTV
	// Logging mechanism to allow clients to log to the server
	Log *Log
	// Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices
	//
	// Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below.
	//
	// Example SSDP output
	// “`
	// <root xmlns="urn:schemas-upnp-org:device-1-0">
	//     <specVersion>
	//         <major>1</major>
	//         <minor>0</minor>
	//     </specVersion>
	//     <device>
	//         <deviceType>urn:plex-tv:device:Media:1</deviceType>
	//         <friendlyName>Turing Hopper 3000</friendlyName>
	//         <manufacturer>Plex, Inc.</manufacturer>
	//         <manufacturerURL>https://plex.tv/</manufacturerURL>
	//         <modelDescription>Turing Hopper 3000 Media Grabber</modelDescription>
	//         <modelName>Plex Media Grabber</modelName>
	//         <modelNumber>1</modelNumber>
	//         <modelURL>https://plex.tv</modelURL>
	//         <UDN>uuid:42fde8e4-93b6-41e5-8a63-12d848655811</UDN>
	//         <serviceList>
	//             <service>
	//                 <URLBase>http://10.0.0.5:8088</URLBase>
	//                 <serviceType>urn:plex-tv:service:MediaGrabber:1</serviceType>
	//                 <serviceId>urn:plex-tv:serviceId:MediaGrabber</serviceId>
	//             </service>
	//         </serviceList>
	//     </device>
	// </root>
	// “`
	//
	//   - UDN: (string) A UUID for the device. This should be unique across models of a device at minimum.
	//   - URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted.
	//
	Devices *Devices
	// Media providers are the starting points for the entire Plex Media Server media library API.  It defines the paths for the groups of endpoints.  The `/media/providers` should be the only hard-coded path in clients when accessing the media library.  Non-media library endpoints are outside the scope of the media provider.  See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers.
	Provider *Provider
	// Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available
	//
	Subscriptions *Subscriptions
	// API Operations against the Transcoder
	Transcoder *Transcoder
	// Media playlists that can be created and played back
	Playlist *Playlist
	// Endpoints for manipulating playlists.
	LibraryPlaylists *LibraryPlaylists
	// The playqueue feature within a media provider
	// A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session.  There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue.
	// Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed.
	// You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion.
	// All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area.
	// The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item.
	PlayQueue *PlayQueue
	// Service provided to compute UltraBlur colors and images.
	UltraBlur *UltraBlur
	// The status endpoints give you information about current playbacks, play history, and even terminating sessions.
	Status *Status
	// 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
	Authentication *Authentication
	Users          *Users
	Plex           *Plex
	// The actual content of the media provider
	Content *Content
	// Endpoints for manipulating collections.  In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well.
	LibraryCollections *LibraryCollections
	// contains filtered or unexported fields
}

func New

func New(opts ...SDKOption) *PlexAPI

New creates a new instance of the SDK with the provided options

type Preferences added in v0.26.0

type Preferences struct {
	// contains filtered or unexported fields
}

Preferences - API Operations against the Preferences

func (*Preferences) GetAllPreferences added in v0.26.0

func (s *Preferences) GetAllPreferences(ctx context.Context, opts ...operations.Option) (*operations.GetAllPreferencesResponse, error)

GetAllPreferences - Get all preferences Get the list of all preferences

func (*Preferences) GetPreference added in v0.26.0

GetPreference - Get a preferences Get a single preference and value

func (*Preferences) SetPreferences added in v0.26.0

SetPreferences - Set preferences Set a set of preferences in query parameters

type Provider added in v0.26.0

type Provider struct {
	// contains filtered or unexported fields
}

Provider - Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See [the section in API Info](#section/API-Info/Media-Providers) for more information on how to use media providers.

func (*Provider) AddProvider added in v0.26.0

AddProvider - Add a media provider This endpoint registers a media provider with the server. Once registered, the media server acts as a reverse proxy to the provider, allowing both local and remote providers to work.

func (*Provider) DeleteMediaProvider added in v0.26.0

DeleteMediaProvider - Delete a media provider Deletes a media provider with the given id

func (*Provider) ListProviders added in v0.26.0

func (s *Provider) ListProviders(ctx context.Context, opts ...operations.Option) (*operations.ListProvidersResponse, error)

ListProviders - Get the list of available media providers Get the list of all available media providers for this PMS. This will generally include the library provider and possibly EPG if DVR is set up.

func (*Provider) RefreshProviders added in v0.26.0

func (s *Provider) RefreshProviders(ctx context.Context, opts ...operations.Option) (*operations.RefreshProvidersResponse, error)

RefreshProviders - Refresh media providers Refresh all known media providers. This is useful in case a provider has updated features.

type Rate added in v0.26.0

type Rate struct {
	// contains filtered or unexported fields
}

Rate - Operations for rating media items (thumbs up/down, star ratings, etc.)

func (*Rate) SetRating added in v0.26.0

SetRating - Rate an item Set the rating on an item. This API does respond to the GET verb but applications should use PUT

type SDKOption

type SDKOption func(*PlexAPI)

func WithAccepts added in v0.26.0

func WithAccepts(accepts components.Accepts) SDKOption

WithAccepts allows setting the Accepts parameter for all supported operations

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithClientIdentifier added in v0.26.0

func WithClientIdentifier(clientIdentifier string) SDKOption

WithClientIdentifier allows setting the ClientIdentifier parameter for all supported operations

func WithDevice added in v0.26.0

func WithDevice(device string) SDKOption

WithDevice allows setting the Device parameter for all supported operations

func WithDeviceName added in v0.11.11

func WithDeviceName(deviceName string) SDKOption

WithDeviceName allows setting the DeviceName parameter for all supported operations

func WithDeviceVendor added in v0.26.0

func WithDeviceVendor(deviceVendor string) SDKOption

WithDeviceVendor allows setting the DeviceVendor parameter for all supported operations

func WithFullServerURL added in v0.27.0

func WithFullServerURL(fullServerURL string) SDKOption

WithFullServerURL allows setting the full_server_url variable for url substitution

func WithHost added in v0.26.0

func WithHost(host string) SDKOption

WithHost allows setting the host variable for url substitution

func WithIPDescription added in v0.26.0

func WithIPDescription(ipDescription string) SDKOption

WithIPDescription allows setting the IP-description variable for url substitution

func WithIdentifier added in v0.26.0

func WithIdentifier(identifier string) SDKOption

WithIdentifier allows setting the identifier variable for url substitution

func WithMarketplace added in v0.26.0

func WithMarketplace(marketplace string) SDKOption

WithMarketplace allows setting the Marketplace parameter for all supported operations

func WithModel added in v0.26.0

func WithModel(model string) SDKOption

WithModel allows setting the Model parameter for all supported operations

func WithPlatform added in v0.15.0

func WithPlatform(platform string) SDKOption

WithPlatform allows setting the Platform parameter for all supported operations

func WithPlatformVersion added in v0.26.0

func WithPlatformVersion(platformVersion string) SDKOption

WithPlatformVersion allows setting the PlatformVersion parameter for all supported operations

func WithPort

func WithPort(port string) SDKOption

WithPort allows setting the port variable for url substitution

func WithProduct added in v0.26.0

func WithProduct(product string) SDKOption

WithProduct allows setting the Product parameter for all supported operations

func WithProtocol

func WithProtocol(protocol string) SDKOption

WithProtocol allows setting the protocol variable for url substitution

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(token string) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource added in v0.2.1

func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout added in v0.11.1

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

func WithVersion added in v0.26.0

func WithVersion(version string) SDKOption

WithVersion allows setting the Version parameter for all supported operations

type Search struct {
	// contains filtered or unexported fields
}

Search - The search feature within a media provider

func (*Search) SearchHubs added in v0.26.0

SearchHubs - Search Hub Perform a search and get the result as hubs

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) VoiceSearchHubs added in v0.26.0

VoiceSearchHubs - Voice Search Hub Perform a search tailored to voice input and get the result as hubs

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 Status added in v0.26.0

type Status struct {
	// contains filtered or unexported fields
}

Status - The status endpoints give you information about current playbacks, play history, and even terminating sessions.

func (*Status) DeleteHistory added in v0.26.0

DeleteHistory - Delete Single History Item Delete a single history item by id

func (*Status) GetBackgroundTasks added in v0.26.0

func (s *Status) GetBackgroundTasks(ctx context.Context, opts ...operations.Option) (*operations.GetBackgroundTasksResponse, error)

GetBackgroundTasks - Get background tasks Get the list of all background tasks

func (*Status) GetHistoryItem added in v0.26.0

GetHistoryItem - Get Single History Item Get a single history item by id

func (*Status) ListPlaybackHistory added in v0.26.0

ListPlaybackHistory - List Playback History List all playback history (Admin can see all users, others can only see their own). Pagination should be used on this endpoint. Additionally this endpoint supports `includeFields`, `excludeFields`, `includeElements`, and `excludeElements` parameters.

func (*Status) ListSessions added in v0.26.0

func (s *Status) ListSessions(ctx context.Context, opts ...operations.Option) (*operations.ListSessionsResponse, error)

ListSessions - List Sessions List all current playbacks on this server

func (*Status) TerminateSession added in v0.26.0

TerminateSession - Terminate a session Terminate a playback session kicking off the user

type Subscriptions added in v0.26.0

type Subscriptions struct {
	// contains filtered or unexported fields
}

Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available

func (*Subscriptions) CancelGrab added in v0.26.0

CancelGrab - Cancel an existing grab Cancels an existing media grab (recording). It can be used to resolve a conflict which exists for a rolling subscription. Note: This cancellation does not persist across a server restart, but neither does a rolling subscription itself.

func (*Subscriptions) CreateSubscription added in v0.26.0

CreateSubscription - Create a subscription Create a subscription. The query parameters should be mostly derived from the [template](#tag/Subscriptions/operation/mediaSubscriptionsGetTemplate)

func (*Subscriptions) DeleteSubscription added in v0.26.0

DeleteSubscription - Delete a subscription Delete a subscription, cancelling all of its grabs as well

func (*Subscriptions) EditSubscriptionPreferences added in v0.26.0

EditSubscriptionPreferences - Edit a subscription Edit a subscription's preferences

func (*Subscriptions) GetAllSubscriptions added in v0.26.0

GetAllSubscriptions - Get all subscriptions Get all subscriptions and potentially the grabs too

func (*Subscriptions) GetScheduledRecordings added in v0.26.0

func (s *Subscriptions) GetScheduledRecordings(ctx context.Context, opts ...operations.Option) (*operations.GetScheduledRecordingsResponse, error)

GetScheduledRecordings - Get all scheduled recordings Get all scheduled recordings across all subscriptions

func (*Subscriptions) GetSubscription added in v0.26.0

GetSubscription - Get a single subscription Get a single subscription and potentially the grabs too

func (*Subscriptions) GetTemplate added in v0.26.0

GetTemplate - Get the subscription template Get the templates for a piece of media which could include fetching one airing, season, the whole show, etc.

func (*Subscriptions) ProcessSubscriptions added in v0.26.0

func (s *Subscriptions) ProcessSubscriptions(ctx context.Context, opts ...operations.Option) (*operations.ProcessSubscriptionsResponse, error)

ProcessSubscriptions - Process all subscriptions Process all subscriptions asynchronously

func (*Subscriptions) ReorderSubscription added in v0.26.0

ReorderSubscription - Re-order a subscription Re-order a subscription to change its priority

type Timeline added in v0.26.0

type Timeline struct {
	// contains filtered or unexported fields
}

Timeline - The actions feature within a media provider

func (*Timeline) MarkPlayed added in v0.26.0

MarkPlayed - Mark an item as played Mark an item as played. Note, this does not create any view history of this item but rather just sets the state as played. The client must provide either the `key` or `uri` query parameter This API does respond to the GET verb but applications should use PUT

func (*Timeline) Report added in v0.26.0

Report media timeline This endpoint is hit during media playback for an item. It must be hit whenever the play state changes, or in the absence of a play state change, in a regular fashion (generally this means every 10 seconds on a LAN/WAN, and every 20 seconds over cellular).

func (*Timeline) Unscrobble added in v0.26.0

Unscrobble - Mark an item as unplayed Mark an item as unplayed. The client must provide either the `key` or `uri` query parameter This API does respond to the GET verb but applications should use PUT

type Transcoder added in v0.26.0

type Transcoder struct {
	// contains filtered or unexported fields
}

Transcoder - API Operations against the Transcoder

func (*Transcoder) MakeDecision added in v0.26.0

MakeDecision - Make a decision on media playback Make a decision on media playback based on client profile, and requested settings such as bandwidth and resolution.

func (*Transcoder) StartTranscodeSession added in v0.26.0

StartTranscodeSession - Start A Transcoding Session Starts the transcoder and returns the corresponding streaming resource document.

func (*Transcoder) TranscodeImage added in v0.26.0

TranscodeImage - Transcode an image Transcode an image, possibly changing format or size

func (*Transcoder) TranscodeSubtitles added in v0.26.0

TranscodeSubtitles - Transcode subtitles Only transcode subtitle streams.

func (*Transcoder) TriggerFallback added in v0.26.0

TriggerFallback - Manually trigger a transcoder fallback Manually trigger a transcoder fallback ex: HEVC to h.264 or hw to sw

type UltraBlur added in v0.26.0

type UltraBlur struct {
	// contains filtered or unexported fields
}

UltraBlur - Service provided to compute UltraBlur colors and images.

func (*UltraBlur) GetColors added in v0.26.0

GetColors - Get UltraBlur Colors Retrieves the four colors extracted from an image for clients to use to generate an ultrablur image.

func (*UltraBlur) GetImage added in v0.26.0

GetImage - Get UltraBlur Image Retrieves a server-side generated UltraBlur image based on the provided color inputs. Clients should always call this via the photo transcoder endpoint.

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

ApplyUpdates - Applying updates Apply any downloaded updates. Note that the two parameters `tonight` and `skip` are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed.

func (*Updater) CheckUpdates added in v0.26.0

CheckUpdates - Checking for updates Perform an update check and potentially download

func (*Updater) GetUpdatesStatus added in v0.26.0

func (s *Updater) GetUpdatesStatus(ctx context.Context, opts ...operations.Option) (*operations.GetUpdatesStatusResponse, error)

GetUpdatesStatus - Querying status of updates Get the status of updating the server

type Users added in v0.18.0

type Users struct {
	// contains filtered or unexported fields
}

func (*Users) GetUsers added in v0.18.0

GetUsers - Get list of all connected users Get list of all users that are friends and have library access with the provided Plex authentication token

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL