plex

package
v0.0.0-...-e14edc6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package plex implements a Pilot media server plugin for Plex. On import_complete it triggers a library section refresh so the new movie appears immediately.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL           string `json:"url"`
	Token         string `json:"token"`
	SkipTLSVerify bool   `json:"skip_tls_verify,omitempty"`
}

Config holds the user-supplied settings for a Plex media server.

type Movie

type Movie struct {
	RatingKey string `json:"rating_key"`
	Title     string `json:"title"`
	Year      int    `json:"year"`
	TmdbID    int    `json:"tmdb_id"` // 0 if no TMDB guid found
}

Movie represents a movie in a Plex library section.

type Section

type Section struct {
	Key   string `json:"key"`
	Title string `json:"title"`
	Type  string `json:"type"`
}

Section is a public representation of a Plex library section.

type Server

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

Server is a Plex media server plugin instance.

func New

func New(cfg Config) *Server

New creates a new Server from the given config.

func (*Server) ListMovies

func (s *Server) ListMovies(ctx context.Context, sectionKey string) ([]Movie, error)

ListMovies returns all movies in the given Plex library section.

func (*Server) ListSections

func (s *Server) ListSections(ctx context.Context) ([]Section, error)

ListSections returns the movie library sections from this Plex server.

func (*Server) Name

func (s *Server) Name() string

func (*Server) RefreshLibrary

func (s *Server) RefreshLibrary(ctx context.Context, moviePath string) error

RefreshLibrary triggers a refresh of the Plex library section that contains moviePath. If no matching section is found, it falls back to refreshing all movie sections.

func (*Server) Test

func (s *Server) Test(ctx context.Context) error

Test verifies that the Plex server is reachable with the configured token.

func (*Server) WatchHistory

func (s *Server) WatchHistory(ctx context.Context, since time.Time) ([]plugin.WatchEvent, error)

WatchHistory returns watch events since the given timestamp. Implements plugin.WatchProvider.

Jump to

Keyboard shortcuts

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