plex

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheLifetime int

CacheLifetime controls when a cached image will be refreshed in days

View Source
var ShortVersion = strings.Split(Version, "-")[0]

ShortVersion contains the version in the format "1.2.3"

View Source
var Version = "0.0.0-default"

Version contains the version of the app, this contains the version with any pre-release metadata "1.2.3-prerelease.4"

Functions

func CreateURI

func CreateURI(server Host, path string) string

CreateURI assembles the URI for an API request

func RemoveCachedToken added in v0.2.0

func RemoveCachedToken() error

RemoveCachedToken removes the cached tokenfile

func SelectedShows added in v0.3.0

func SelectedShows() ([]string, error)

SelectedShows returns the selected tv shows from the tvShowsFile

func SyncWatchedTv

func SyncWatchedTv(source, destination Host) error

SyncWatchedTv synchronises the watched TV Shows

func Token

func Token() string

Token requests a MyPlex authentication token from cache or from MyPlex.

func TokenRequest added in v0.2.0

func TokenRequest(cred Credentials) error

TokenRequest requests a new token from MyPlex

Types

type Credentials added in v0.2.0

type Credentials struct {
	Username string
	Password string
}

Credentials stores MyPlex credentials

type ER

type ER struct {
	XMLName xml.Name  `xml:"MediaContainer"`
	Video   []Episode `xml:"Video"`
}

ER contains episode results

type Episode

type Episode struct {
	ID          int    `xml:"ratingKey,attr"`
	Name        string `xml:"title,attr"`
	Episode     int    `xml:"index,attr"`
	Season      int    `xml:"parentIndex,attr"`
	ViewCount   int    `xml:"viewCount,attr"`
	LastWatched int    `xml:"lastViewedAt,attr"`
}

Episode defines the structure of a Plex TV Episode

type Host

type Host struct {
	gorm.Model
	Name     string
	Hostname string
	Port     int
	Ssl      bool
	Token    string
}

Host defines the data to be stored for server objects

func (*Host) GetToken

func (h *Host) GetToken(t string) error

GetToken requests the AccessToken from MyPlex for the named server

type SR

type SR struct {
	XMLName     xml.Name `xml:"MediaContainer"`
	Directories []Show   `xml:"Directory"`
}

SR contains search results

type Show

type Show struct {
	ID           int    `xml:"ratingKey,attr"`
	Name         string `xml:"title,attr"`
	EpisodeCount int    `xml:"leafCount,attr"`
	Thumbnail    string `xml:"thumb,attr"`
	Banner       string `xml:"banner,attr"`
}

Show defines the structure of a Plex TV Show

func SearchShow

func SearchShow(server Host, title string) (Show, error)

SearchShow returns all episodes for a given TV Show

Jump to

Keyboard shortcuts

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