Versions in this module Expand all Collapse all v1 v1.1.3 Jul 15, 2026 v1.1.2 Jul 15, 2026 v1.1.1 Jul 14, 2026 v1.1.0 Jul 14, 2026 Changes in this version + const DefaultMaxBodyBytes + const DefaultMaxListBodyBytes + func IsConfigError(err error) bool type Option + func WithLogger(l *slog.Logger) Option + func WithMaxBodyBytes(n int64) Option + func WithMaxListBodyBytes(n int64) Option v1.0.0 Jul 14, 2026retracted Changes in this version + const MetadataTypeEpisode + const SectionTypeMovie + const SectionTypeShow + const TypeEpisode + var ErrNotFound = errors.New("not found") + func IsFatalStartup(err error) bool + func IsNotFound(err error) bool + type Account struct + ID int + Name string + type Client struct + func New(baseURL, token string, opts ...Option) (*Client, error) + func (c *Client) Accounts(ctx context.Context) ([]Account, error) + func (c *Client) AdminAccount(ctx context.Context) (*Account, error) + func (c *Client) AllLeaves(ctx context.Context, key RatingKey) ([]Item, error) + func (c *Client) BaseURL() *url.URL + func (c *Client) Children(ctx context.Context, key RatingKey) ([]Item, error) + func (c *Client) ContainerTotalSize(ctx context.Context, path string) (int64, error) + func (c *Client) DisableSubtitles(ctx context.Context, partID int) error + func (c *Client) ForToken(token string) *Client + func (c *Client) Get(ctx context.Context, path string, result any) error + func (c *Client) HTTPClient() *http.Client + func (c *Client) History(ctx context.Context, sinceUnix int64) ([]Item, error) + func (c *Client) Identity(ctx context.Context) (*ServerIdentity, error) + func (c *Client) ItemExists(ctx context.Context, key RatingKey) (bool, error) + func (c *Client) ItemsByGUID(ctx context.Context, guid string) ([]Item, error) + func (c *Client) Metadata(ctx context.Context, key RatingKey) (*Item, error) + func (c *Client) MyPlexUsername(ctx context.Context) (string, error) + func (c *Client) Providers(ctx context.Context) (*MediaProviders, error) + func (c *Client) RecentlyAdded(ctx context.Context, sectionKey RatingKey, metadataType int, sinceUnix int64) ([]Item, error) + func (c *Client) SectionItems(ctx context.Context, sectionKey RatingKey) ([]Item, error) + func (c *Client) Sections(ctx context.Context) ([]Section, error) + func (c *Client) Sessions(ctx context.Context) ([]Item, error) + func (c *Client) SetAudioStream(ctx context.Context, partID, streamID int) error + func (c *Client) SetSubtitleStream(ctx context.Context, partID, streamID int) error + func (c *Client) ShowForEpisodeGUID(ctx context.Context, episodeGUID string) (string, error) + func (c *Client) StatisticsBandwidth(ctx context.Context, timespan int) ([]StatisticsBandwidth, error) + func (c *Client) StatisticsResources(ctx context.Context, timespan int) ([]StatisticsResource, error) + func (c *Client) Token() string + type FlexInt int + func (f *FlexInt) UnmarshalJSON(data []byte) error + type GUID struct + ID string + type Item struct + AccountID FlexInt + AddedAt int64 + GUID string + GUIDs []GUID + GrandparentKey string + GrandparentRatingKey string + GrandparentTitle string + Index FlexInt + Key string + Label []Label + LibrarySectionID FlexInt + LibrarySectionTitle string + Media []Media + ParentIndex FlexInt + ParentRatingKey string + ParentTitle string + Player *Player + RatingKey string + Session *SessionBandwidth + SessionKey string + Title string + TranscodeSession *TranscodeSession + Type string + User *SessionUser + ViewedAt int64 + Year int + func (i *Item) EpisodeNum() int + func (i *Item) SeasonNum() int + type Label struct + Tag string + type MC struct + MediaContainer T + type Media struct + Bitrate int + ID int + Part []Part + VideoResolution string + type MediaProvider struct + Features []ProviderFeature + Identifier string + type MediaProviders struct + FriendlyName string + MachineIdentifier string + MediaProviders []MediaProvider + Version string + type Option func(*options) + func WithBaseDelay(d time.Duration) Option + func WithCACertPEM(pem []byte) Option + func WithHTTPClient(hc *http.Client) Option + func WithMaxAttempts(n int) Option + func WithOnRetry(fn httpx.OnRetry) Option + func WithTimeout(d time.Duration) Option + type Part struct + Decision string + ID int + Stream []Stream + type Player struct + Device string + Local bool + MachineIdentifier string + Product string + State string + type ProviderDirectory struct + DurationTotal int64 + ID string + StorageTotal int64 + Title string + Type string + type ProviderFeature struct + Directories []ProviderDirectory + Type string + type RatingKey string + func (r RatingKey) String() string + func (r RatingKey) Validate() error + type ResponseTooLargeError struct + Limit int64 + Path string + func (e *ResponseTooLargeError) Error() string + type Section struct + Key string + Title string + Type string + type ServerIdentity struct + FriendlyName string + MachineIdentifier string + MyPlexSubscription bool + Platform string + PlatformVersion string + TranscoderActiveVideoSessions int + Version string + type SessionBandwidth struct + Bandwidth int + Location string + type SessionUser struct + ID FlexInt + Title string + type SharedServer struct + AccessToken string + UserID string + Username string + type StatisticsBandwidth struct + At int + Bytes int64 + type StatisticsResource struct + HostCPUUtilization float64 + HostMemoryUtilization float64 + type StatusError struct + Code int + Method string + Path string + Status string + func (e *StatusError) Error() string + type Stream struct + AudioChannelLayout string + Channels int + Codec string + DisplayTitle string + ExtendedDisplayTitle string + Forced bool + HearingImpaired bool + ID int + LanguageCode string + LanguageTag string + Selected bool + StreamType StreamType + Title string + VisualImpaired bool + func (s *Stream) IsAudio() bool + func (s *Stream) IsSubtitle() bool + type StreamType int + const StreamTypeAudio + const StreamTypeSubtitle + const StreamTypeVideo + type TV struct + func NewTV(token string, opts ...TVOption) *TV + func (t *TV) SharedServers(ctx context.Context, machineIdentifier string) ([]SharedServer, error) + type TVOption func(*TV) + func WithTVBaseURL(base string) TVOption + func WithTVHTTPClient(hc *http.Client) TVOption + type TranscodeSession struct + AudioCodec string + AudioDecision string + SourceAudioCodec string + SourceVideoCodec string + SubtitleDecision string + VideoCodec string + VideoDecision string