Documentation
¶
Index ¶
- type Client
- func (c *Client) GetAllMedia(ctx context.Context, progressCallback ProgressCallback) ([]MediaItem, error)
- func (c *Client) GetLibraries(ctx context.Context) ([]Library, error)
- func (c *Client) GetMediaFromSection(ctx context.Context, sectionKey, sectionType string) ([]MediaItem, error)
- func (c *Client) GetStreamURL(mediaKey string) (string, error)
- func (c *Client) Test() error
- type Library
- type MediaItem
- type ProgressCallback
- type Server
- type ServerProgressCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithName ¶
NewWithName creates a new Plex client with a server name
func (*Client) GetAllMedia ¶
func (c *Client) GetAllMedia(ctx context.Context, progressCallback ProgressCallback) ([]MediaItem, error)
GetAllMedia returns all media items from all libraries
func (*Client) GetLibraries ¶
GetLibraries returns all library sections using direct HTTP to avoid unmarshaling issues
func (*Client) GetMediaFromSection ¶
func (c *Client) GetMediaFromSection(ctx context.Context, sectionKey, sectionType string) ([]MediaItem, error)
GetMediaFromSection returns media items from a specific library section
func (*Client) GetStreamURL ¶
GetStreamURL returns the direct stream URL for a media item This gets the actual file URL that can be streamed by MPV
type MediaItem ¶
type MediaItem struct {
Key string
Title string
Year int
Type string // movie, show, season, episode
Summary string
Rating float64
Duration int
FilePath string
RclonePath string
ParentTitle string // For episodes: show name
GrandTitle string // For episodes: season name
Index int64 // Episode or season number
ParentIndex int64 // Season number for episodes
Thumb string // Poster/thumbnail URL path
ServerName string // Name of the Plex server this item belongs to
ServerURL string // URL of the Plex server this item belongs to
}
func GetAllMediaFromServers ¶
func GetAllMediaFromServers(ctx context.Context, serverConfigs []struct{ Name, URL, Token string }, progressCallback ServerProgressCallback) ([]MediaItem, error)
GetAllMediaFromServers returns all media items from multiple Plex servers
func (*MediaItem) FormatMediaTitle ¶
FormatMediaTitle returns a formatted title for display
type ProgressCallback ¶
type ProgressCallback func(libraryName string, itemCount int, totalLibraries int, currentLibrary int)
ProgressCallback is called during media fetching to report progress
Click to show internal directories.
Click to hide internal directories.