plex

package
v0.0.0-...-2c88b72 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ServerConfig
}

func NewClient

func NewClient(cfg ServerConfig) Client

func (Client) FindLibrary

func (c Client) FindLibrary(name string) (library Library, err error)

lookup library id from name

func (Client) Get

func (c Client) Get(format string, query map[string]string, result interface{}, a ...interface{}) error

type Library

type Library struct {
	Id   string    `xml:"key,attr"`
	Name string    `xml:"title,attr"`
	Type MediaType `xml:"type,attr"`
	// contains filtered or unexported fields
}

func (Library) Details

func (l Library) Details(file Video) (*Video, error)

list library contents

func (Library) HasVideo

func (l Library) HasVideo(dirName, filename string) (bool, error)

func (Library) List

func (l Library) List() ([]Video, error)

list library contents

func (*Library) Update

func (l *Library) Update() error

refresh library

type LibraryConfig

type LibraryConfig struct {
	ServerConfig
	Name  string
	Share string
}

LibraryConfig is the set of information necessary to upload videos to a Plex library.

type MediaType

type MediaType string
const (
	Movie   MediaType = "movie"
	Show    MediaType = "show"
	Season  MediaType = "season"
	Episode MediaType = "episode"
	Artist  MediaType = "artist"
	Album   MediaType = "album"
	Track   MediaType = "track"
	Photo   MediaType = "photo"
)

func (MediaType) ToFilter

func (t MediaType) ToFilter() string

type ServerConfig

type ServerConfig struct {
	URL   string
	Token string
}

ServerConfig is the set of information necessary to connect to a Plex server.

type Video

type Video struct {
	Name   string      `xml:"title,attr"`
	Key    string      `xml:"key,attr"`
	Type   MediaType   `xml:"type,attr"`
	Files  []VideoFile `xml:"Media>Part"`
	Extras []VideoFile `xml:"Extras>Video>Media>Part"`
}

type VideoFile

type VideoFile struct {
	Path string `xml:"file,attr"`
}

func (VideoFile) DirName

func (vf VideoFile) DirName() string

func (VideoFile) FileName

func (vf VideoFile) FileName() string

Jump to

Keyboard shortcuts

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