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 ¶
- type Config
- type Movie
- type Section
- type Server
- func (s *Server) ListMovies(ctx context.Context, sectionKey string) ([]Movie, error)
- func (s *Server) ListSections(ctx context.Context) ([]Section, error)
- func (s *Server) Name() string
- func (s *Server) RefreshLibrary(ctx context.Context, moviePath string) error
- func (s *Server) Test(ctx context.Context) error
- func (s *Server) WatchHistory(ctx context.Context, since time.Time) ([]plugin.WatchEvent, error)
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 (*Server) ListMovies ¶
ListMovies returns all movies in the given Plex library section.
func (*Server) ListSections ¶
ListSections returns the movie library sections from this Plex server.
func (*Server) RefreshLibrary ¶
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) WatchHistory ¶
WatchHistory returns watch events since the given timestamp. Implements plugin.WatchProvider.