plex

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlexLibraryTypeUnknown = iota
	PlexLibraryTypeMovie
	PlexLibraryTypeShow
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID    int64  `json:"id"`
	Thumb string `json:"thumb"`
	Title string `json:"title"`
}

type Client

type Client struct {
	URL   string
	Token string
	Debug bool

	MachineIdentifier string
	ClientIdentifier  string
	Product           string
	Device            string
	AppName           string
	MetadataURL       string
	PlexTVURL         string
	Headers           map[string]string
	// contains filtered or unexported fields
}

func New

func New(opt *ClientOptions) *Client

func (*Client) CheckPin

func (p *Client) CheckPin(pin *Pin) (bool, error)

func (*Client) CreateCollection

func (p *Client) CreateCollection(title, section, firstKey string) (*PlexCollectionCreate, error)

func (*Client) CreatePin

func (p *Client) CreatePin() (*Pin, error)

CreatePin returns a new pin from the plex api

func (*Client) DeleteCollection

func (p *Client) DeleteCollection(ratingKey string) error

func (*Client) GetAuthUrl

func (p *Client) GetAuthUrl(redirect string, pin *Pin) string

func (*Client) GetClients

func (p *Client) GetClients() (*ClientsResponse, error)

func (*Client) GetCollection

func (p *Client) GetCollection(ratingKey string) (*PlexCollection, error)

func (*Client) GetCollectionChildren

func (p *Client) GetCollectionChildren(ratingKey string) ([]*PlexCollectionChild, error)

func (*Client) GetDevices

func (p *Client) GetDevices() (map[string]any, error)

func (*Client) GetLibraries

func (p *Client) GetLibraries() ([]*PlexLibrary, error)

func (*Client) GetMetadataByKey

func (p *Client) GetMetadataByKey(key string) (string, error)

func (*Client) GetResources

func (p *Client) GetResources() ([]*Resource, error)

func (*Client) GetSeriesEpisodes

func (p *Client) GetSeriesEpisodes(key string) ([]*PlexLeavesMetadata, error)

func (*Client) GetSeriesEpisodesUnwatched

func (p *Client) GetSeriesEpisodesUnwatched(key string) (*PlexLeavesMetadata, error)

func (*Client) GetSessions

func (p *Client) GetSessions() ([]*PlexSessionMetadata, error)

func (*Client) GetUser

func (p *Client) GetUser(token string) (*PlexUser, error)

func (*Client) GetViewedByKey

func (p *Client) GetViewedByKey(key string) (*PlexLibraryMetadata, error)

func (*Client) GetWatchlist

func (p *Client) GetWatchlist(token string) (*PlexWatchlist, error)

func (*Client) GetWatchlistDetail

func (p *Client) GetWatchlistDetail(token string, w *PlexWatchlist) ([]*PlexWatchlistDetail, error)

func (*Client) LibraryByPath

func (p *Client) LibraryByPath(path string) (*PlexLibrary, error)

func (*Client) LibraryType

func (p *Client) LibraryType(section string) (int, error)

func (*Client) LibraryTypeID

func (p *Client) LibraryTypeID(t string) int

func (*Client) LibraryTypeName

func (p *Client) LibraryTypeName(section string) (string, error)

func (*Client) ListCollections

func (p *Client) ListCollections(section string) ([]*PlexCollection, error)

func (*Client) Play

func (p *Client) Play(ratingKey, player string) error

func (*Client) RefreshLibraryPath

func (p *Client) RefreshLibraryPath(path string) error

func (*Client) Search

func (p *Client) Search(query, section string) ([]SearchMetadata, error)

func (*Client) Stop

func (p *Client) Stop(session string) error

func (*Client) UpdateCollection

func (p *Client) UpdateCollection(section, ratingKey string, keys []string) error

type ClientOptions

type ClientOptions struct {
	URL   string
	Token string
	Debug bool

	MachineIdentifier string
	ClientIdentifier  string
	Product           string
	Device            string
	AppName           string
	MetadataURL       string
	PlexTVURL         string
}

type ClientsResponse

type ClientsResponse struct {
	MediaContainer struct {
		Size   int64           `json:"size"`
		Server []*ServerClient `json:"Server"`
	} `json:"MediaContainer"`
}

type Connection

type Connection struct {
	Protocol string `json:"protocol"`
	Address  string `json:"address"`
	Port     int64  `json:"port"`
	URI      string `json:"uri"`
	Local    bool   `json:"local"`
	Relay    bool   `json:"relay"`
	IPv6     bool   `json:"IPv6"`
}

type Country

type Country struct {
	Tag string `json:"tag"`
}

type Director

type Director struct {
	ID        string  `json:"id"`
	Slug      string  `json:"slug"`
	Tag       string  `json:"tag"`
	Role      string  `json:"role"`
	Directory bool    `json:"directory"`
	Thumb     *string `json:"thumb,omitempty"`
}

type Field

type Field struct {
	Locked bool   `json:"locked"`
	Name   string `json:"name"`
}

type GUID

type GUID struct {
	ID string `json:"id"`
}

type Genre

type Genre struct {
	Filter      string  `json:"filter"`
	ID          string  `json:"id"`
	RatingKey   string  `json:"ratingKey"`
	Slug        string  `json:"slug"`
	Tag         string  `json:"tag"`
	Directory   bool    `json:"directory"`
	Context     string  `json:"context"`
	OriginalTag *string `json:"originalTag,omitempty"`
}

type HookData

type HookData struct {
	Payload HookPayload `json:"payload"`
}

type HookPayload

type HookPayload struct {
	Event    string              `json:"event"`
	User     bool                `json:"user"`
	Owner    bool                `json:"owner"`
	Account  Account             `json:"Account"`
	Server   Server              `json:"Server"`
	Player   Player              `json:"Player"`
	Metadata HookPayloadMetadata `json:"Metadata"`
}

type HookPayloadMetadata

type HookPayloadMetadata struct {
	LibrarySectionType   string `json:"librarySectionType"`
	RatingKey            string `json:"ratingKey"`
	Key                  string `json:"key"`
	ParentRatingKey      string `json:"parentRatingKey"`
	GrandparentRatingKey string `json:"grandparentRatingKey"`
	GUID                 string `json:"guid"`
	LibrarySectionID     int64  `json:"librarySectionID"`
	Type                 string `json:"type"`
	Title                string `json:"title"`
	GrandparentKey       string `json:"grandparentKey"`
	ParentKey            string `json:"parentKey"`
	GrandparentTitle     string `json:"grandparentTitle"`
	ParentTitle          string `json:"parentTitle"`
	Summary              string `json:"summary"`
	Index                int64  `json:"index"`
	ParentIndex          int64  `json:"parentIndex"`
	RatingCount          int64  `json:"ratingCount"`
	Thumb                string `json:"thumb"`
	Art                  string `json:"art"`
	ParentThumb          string `json:"parentThumb"`
	GrandparentThumb     string `json:"grandparentThumb"`
	GrandparentArt       string `json:"grandparentArt"`
	AddedAt              int64  `json:"addedAt"`
	UpdatedAt            int64  `json:"updatedAt"`
}

type Image

type Image struct {
	Alt  string `json:"alt"`
	Type string `json:"type"`
	URL  string `json:"url"`
}

type Location

type Location struct {
	Path string `json:"path"`
}

type Media

type Media struct {
	ID                    int64   `json:"id"`
	Duration              int64   `json:"duration"`
	Bitrate               int64   `json:"bitrate"`
	Width                 int64   `json:"width"`
	Height                int64   `json:"height"`
	AspectRatio           float64 `json:"aspectRatio"`
	AudioChannels         int64   `json:"audioChannels"`
	AudioCodec            string  `json:"audioCodec"`
	VideoCodec            string  `json:"videoCodec"`
	VideoResolution       string  `json:"videoResolution"`
	Container             string  `json:"container"`
	VideoFrameRate        string  `json:"videoFrameRate"`
	AudioProfile          *string `json:"audioProfile,omitempty"`
	VideoProfile          string  `json:"videoProfile"`
	Part                  []Part  `json:"Part"`
	OptimizedForStreaming *int64  `json:"optimizedForStreaming,omitempty"`
	Has64BitOffsets       *bool   `json:"has64bitOffsets,omitempty"`
}

type Part

type Part struct {
	ID                    int64   `json:"id"`
	Key                   string  `json:"key"`
	Duration              int64   `json:"duration"`
	File                  string  `json:"file"`
	Size                  int64   `json:"size"`
	AudioProfile          *string `json:"audioProfile,omitempty"`
	Container             string  `json:"container"`
	VideoProfile          string  `json:"videoProfile"`
	Has64BitOffsets       *bool   `json:"has64bitOffsets,omitempty"`
	OptimizedForStreaming *bool   `json:"optimizedForStreaming,omitempty"`
}

type Pin

type Pin struct {
	ID         int    `json:"id"`
	Code       string `json:"code"`
	Product    string `json:"product"`
	Token      string `json:"authToken"`
	Identifier string `json:"clientIdentifier"`
}

type Player

type Player struct {
	Local         bool   `json:"local"`
	PublicAddress string `json:"publicAddress"`
	Title         string `json:"title"`
	UUID          string `json:"uuid"`
}

type PlexCollection

type PlexCollection struct {
	RatingKey    string                 `json:"ratingKey"`
	Key          string                 `json:"key"`
	GUID         string                 `json:"guid"`
	Type         string                 `json:"type"`
	Title        string                 `json:"title"`
	LibraryID    int64                  `json:"librarySectionID"`
	LibraryTitle string                 `json:"librarySectionTitle"`
	LibraryKey   string                 `json:"librarySectionKey"`
	Subtype      string                 `json:"subtype"`
	Summary      string                 `json:"summary"`
	Thumb        string                 `json:"thumb"`
	AddedAt      int64                  `json:"addedAt"`
	UpdatedAt    int64                  `json:"updatedAt"`
	ChildCount   string                 `json:"childCount"`
	MaxYear      string                 `json:"maxYear"`
	MinYear      string                 `json:"minYear"`
	Children     []*PlexCollectionChild `json:"children,omitempty"`
}

type PlexCollectionChild

type PlexCollectionChild struct {
	RatingKey    string `json:"ratingKey"`
	Key          string `json:"key"`
	GUID         string `json:"guid"`
	Type         string `json:"type"`
	Title        string `json:"title"`
	LibraryID    int64  `json:"librarySectionID"`
	LibraryTitle string `json:"librarySectionTitle"`
	LibraryKey   string `json:"librarySectionKey"`
	Summary      string `json:"summary"`
	Thumb        string `json:"thumb"`
	AddedAt      int64  `json:"addedAt"`
	UpdatedAt    int64  `json:"updatedAt"`
}

type PlexCollectionChildrenResponse

type PlexCollectionChildrenResponse struct {
	MediaContainer struct {
		Size      int64                  `json:"size"`
		Directory []*PlexCollectionChild `json:"Metadata,omitempty"`
	} `json:"MediaContainer"`
}

type PlexCollectionCreate

type PlexCollectionCreate struct {
	MediaContainer struct {
		Directory []struct {
			RatingKey string `json:"ratingKey"`
			Key       string `json:"key"`
			Guid      string `json:"guid"`
			Type      string `json:"type"`
			Title     string `json:"title"`
			Subtype   string `json:"subtype"`
			Summary   string `json:"summary"`
			Thumb     string `json:"thumb"`
			AddedAt   int64  `json:"addedAt"`
			UpdatedAt int64  `json:"updatedAt"`
		} `json:"Metadata"`
	} `json:"MediaContainer"`
}

type PlexCollectionResponse

type PlexCollectionResponse struct {
	MediaContainer struct {
		Size         int64             `json:"size"`
		AllowSync    bool              `json:"allowSync"`
		Identifier   string            `json:"identifier"`
		LibraryID    int64             `json:"librarySectionID"`
		LibraryTitle string            `json:"librarySectionTitle"`
		LibraryUUID  string            `json:"librarySectionUUID"`
		Title        string            `json:"title1"`
		Subtitle     string            `json:"title2"`
		Directory    []*PlexCollection `json:"Metadata,omitempty"`
	} `json:"MediaContainer"`
}

type PlexLeavesMetadata

type PlexLeavesMetadata struct {
	Key              string   `json:"key"`
	RatingKey        string   `json:"ratingKey"`
	LastViewedAt     int64    `json:"lastViewedAt"`
	Title            string   `json:"title"`
	ParentTitle      string   `json:"parentTitle"`
	GrandparentTitle string   `json:"grandparentTitle"`
	Index            int      `json:"index"`
	AddedAt          int64    `json:"addedAt"`
	UpdatedAt        int64    `json:"updatedAt"`
	Media            []*Media `json:"Media"`
}

type PlexLeavesMetadataContainer

type PlexLeavesMetadataContainer struct {
	MediaContainer struct {
		Size     int64                 `json:"size"`
		Metadata []*PlexLeavesMetadata `json:"Metadata"`
	} `json:"MediaContainer"`
}

type PlexLibraries

type PlexLibraries struct {
	MediaContainer struct {
		Size        int64          `json:"size"`
		Directories []*PlexLibrary `json:"Directory"`
	} `json:"MediaContainer"`
}

type PlexLibrariesCollectionResponse

type PlexLibrariesCollectionResponse struct {
	MediaContainer struct {
		Size         int64             `json:"size"`
		AllowSync    bool              `json:"allowSync"`
		Identifier   string            `json:"identifier"`
		LibraryID    int64             `json:"librarySectionID"`
		LibraryTitle string            `json:"librarySectionTitle"`
		LibraryUUID  string            `json:"librarySectionUUID"`
		Title        string            `json:"title1"`
		Subtitle     string            `json:"title2"`
		Metadata     []*PlexCollection `json:"Metadata,omitempty"`
	} `json:"MediaContainer"`
}

type PlexLibrary

type PlexLibrary struct {
	AllowSync        bool                   `json:"allowSync"`
	Art              string                 `json:"art"`
	Composite        string                 `json:"composite"`
	Filters          bool                   `json:"filters"`
	Refreshing       bool                   `json:"refreshing"`
	Thumb            string                 `json:"thumb"`
	Key              string                 `json:"key"`
	Type             string                 `json:"type"`
	Title            string                 `json:"title"`
	Agent            string                 `json:"agent"`
	Scanner          string                 `json:"scanner"`
	Language         string                 `json:"language"`
	UUID             string                 `json:"uuid"`
	UpdatedAt        int64                  `json:"updatedAt"`
	CreatedAt        int64                  `json:"createdAt"`
	ScannedAt        int64                  `json:"scannedAt"`
	Content          bool                   `json:"content"`
	Directory        bool                   `json:"directory"`
	ContentChangedAt int64                  `json:"contentChangedAt"`
	Hidden           int64                  `json:"hidden"`
	Locations        []*PlexLibraryLocation `json:"Location"`
}

type PlexLibraryLocation

type PlexLibraryLocation struct {
	ID   int64  `json:"id"`
	Path string `json:"path"`
}
{
        "allowSync": true,
        "art": "/:/resources/show-fanart.jpg",
        "composite": "/library/sections/2/composite/1704818054",
        "filters": true,
        "refreshing": true,
        "thumb": "/:/resources/show.png",
        "key": "2",
        "type": "show",
        "title": "TV Shows",
        "agent": "tv.plex.agents.series",
        "scanner": "Plex TV Series",
        "language": "en-US",
        "uuid": "e35a54e6-79ff-4cde-98c6-c05c1a09c821",
        "updatedAt": 1704818112,
        "createdAt": 1384056048,
        "scannedAt": 1704818054,
        "content": true,
        "directory": true,
        "contentChangedAt": 41632394,
        "hidden": 0,
        "Location": [
          {
            "id": 29,
            "path": "/mnt/media/tv"
          }
        ]
      },

type PlexLibraryMetadata

type PlexLibraryMetadata struct {
	Key          string `json:"key"`
	RatingKey    string `json:"ratingKey"`
	Leaves       int    `json:"leafCount"`
	Viewed       int    `json:"viewedLeafCount"`
	LastViewedAt int64  `json:"lastViewedAt"`
}

type PlexLibraryMetadataContainer

type PlexLibraryMetadataContainer struct {
	MediaContainer struct {
		Size     int64                  `json:"size"`
		Metadata []*PlexLibraryMetadata `json:"Metadata"`
	} `json:"MediaContainer"`
}

type PlexQueue

type PlexQueue struct {
	MediaContainer struct {
		Size            int64  `json:"size"`
		Identifier      string `json:"identifier"`
		MediaTagPrefix  string `json:"mediaTagPrefix"`
		MediaTagVersion int64  `json:"mediaTagVersion"`
		Shuffled        bool   `json:"playQueueShuffled"`
		Source          string `json:"playQueueSourceURI"`
		Version         int64  `json:"playQueueVersion"`
		ID              int64  `json:"playQueueID"`
	}
}

type PlexSearch

type PlexSearch struct {
	MediaContainer struct {
		Size         int64            `json:"size"`
		SectionID    int64            `json:"sectionID"`
		AllowSync    bool             `json:"allowSync"`
		Art          string           `json:"art"`
		Identifier   string           `json:"identifier"`
		SectionTitle string           `json:"librarySectionTitle"`
		SectionUUID  string           `json:"librarySectionUUID"`
		Title        string           `json:"title1"`
		Subtitle     string           `json:"title2"`
		Metadata     []SearchMetadata `json:"Metadata,omitempty"`
	} `json:"MediaContainer"`
}

type PlexSessionContainer

type PlexSessionContainer struct {
	MediaContainer struct {
		Size     int64                  `json:"size"`
		Metadata []*PlexSessionMetadata `json:"Metadata"`
	} `json:"MediaContainer"`
}

type PlexSessionMetadata

type PlexSessionMetadata struct {
	AddedAt               int64           `json:"addedAt"`
	Art                   string          `json:"art"`
	ContentRating         string          `json:"contentRating"`
	Duration              int64           `json:"duration"`
	GrandparentArt        string          `json:"grandparentArt"`
	GrandparentGUID       string          `json:"grandparentGuid"`
	GrandparentKey        string          `json:"grandparentKey"`
	GrandparentRatingKey  string          `json:"grandparentRatingKey"`
	GrandparentSlug       string          `json:"grandparentSlug"`
	GrandparentThumb      string          `json:"grandparentThumb"`
	GrandparentTitle      string          `json:"grandparentTitle"`
	GUID                  string          `json:"guid"`
	Index                 int64           `json:"index"`
	Key                   string          `json:"key"`
	LibrarySectionID      string          `json:"librarySectionID"`
	LibrarySectionKey     string          `json:"librarySectionKey"`
	LibrarySectionTitle   string          `json:"librarySectionTitle"`
	OriginalTitle         string          `json:"originalTitle"`
	OriginallyAvailableAt string          `json:"originallyAvailableAt"`
	ParentGUID            string          `json:"parentGuid"`
	ParentIndex           int64           `json:"parentIndex"`
	ParentKey             string          `json:"parentKey"`
	ParentRatingKey       string          `json:"parentRatingKey"`
	ParentTitle           string          `json:"parentTitle"`
	RatingKey             string          `json:"ratingKey"`
	SessionKey            string          `json:"sessionKey"`
	Summary               string          `json:"summary"`
	Thumb                 string          `json:"thumb"`
	Title                 string          `json:"title"`
	Type                  string          `json:"type"`
	UpdatedAt             int64           `json:"updatedAt"`
	ViewOffset            int64           `json:"viewOffset"`
	Year                  int64           `json:"year"`
	Media                 []*SessionMedia `json:"Media"`
	// Role                  []*Role           `json:"Role"`
	User             *User             `json:"User"`
	Player           *SessionPlayer    `json:"Player"`
	Session          *Session          `json:"Session"`
	TranscodeSession *TranscodeSession `json:"TranscodeSession"`
}

type PlexUser

type PlexUser struct {
	ID       int64  `json:"id"`
	UUID     string `json:"uuid"`
	Username string `json:"username"`
	// Title             string      `json:"title"`
	Email string `json:"email"`
	// FriendlyName      string      `json:"friendlyName"`
	// Locale            interface{} `json:"locale"`
	Confirmed bool  `json:"confirmed"`
	JoinedAt  int64 `json:"joinedAt"`
	// EmailOnlyAuth     bool        `json:"emailOnlyAuth"`
	// HasPassword       bool        `json:"hasPassword"`
	// Protected         bool        `json:"protected"`
	Thumb string `json:"thumb"`
	// AuthToken         string      `json:"authToken"`
	// MailingListStatus string      `json:"mailingListStatus"`
	// MailingListActive bool        `json:"mailingListActive"`
	// ScrobbleTypes     string      `json:"scrobbleTypes"`
	// Country           string      `json:"country"`
	// Pin               string      `json:"pin"`
	// Subscription      struct {
	// 	Active         bool     `json:"active"`
	// 	SubscribedAt   string   `json:"subscribedAt"`
	// 	Status         string   `json:"status"`
	// 	PaymentService string   `json:"paymentService"`
	// 	Plan           string   `json:"plan"`
	// 	Features       []string `json:"features"`
	// } `json:"subscription"`
	// SubscriptionDescription string `json:"subscriptionDescription"`
	// Restricted              bool   `json:"restricted"`
	// Anonymous               bool   `json:"anonymous"`
	Home bool `json:"home"`
	// Guest                   bool   `json:"guest"`
	HomeSize  int64 `json:"homeSize"`
	HomeAdmin bool  `json:"homeAdmin"`
}

type PlexWatchlist

type PlexWatchlist struct {
	MediaContainer struct {
		LibrarySectionID    string `json:"librarySectionID"`
		LibrarySectionTitle string `json:"librarySectionTitle"`
		Offset              int64  `json:"offset"`
		TotalSize           int64  `json:"totalSize"`
		Identifier          string `json:"identifier"`
		Size                int64  `json:"size"`
		Metadata            []struct {
			Art                   string   `json:"art"`
			Banner                string   `json:"banner"`
			GUID                  string   `json:"guid"`
			Key                   string   `json:"key"`
			Rating                float64  `json:"rating"`
			RatingKey             string   `json:"ratingKey"`
			Studio                string   `json:"studio"`
			Type                  string   `json:"type"`
			Theme                 *string  `json:"theme,omitempty"`
			Thumb                 string   `json:"thumb"`
			AddedAt               int64    `json:"addedAt"`
			Duration              int64    `json:"duration"`
			PublicPagesURL        string   `json:"publicPagesURL"`
			Slug                  string   `json:"slug"`
			UserState             bool     `json:"userState"`
			Title                 string   `json:"title"`
			OriginalTitle         *string  `json:"originalTitle,omitempty"`
			LeafCount             *int64   `json:"leafCount,omitempty"`
			ChildCount            *int64   `json:"childCount,omitempty"`
			ContentRating         string   `json:"contentRating"`
			OriginallyAvailableAt string   `json:"originallyAvailableAt"`
			Year                  int64    `json:"year"`
			RatingImage           string   `json:"ratingImage"`
			ImdbRatingCount       int64    `json:"imdbRatingCount"`
			Image                 []Image  `json:"Image"`
			PrimaryExtraKey       *string  `json:"primaryExtraKey,omitempty"`
			IsContinuingSeries    *bool    `json:"isContinuingSeries,omitempty"`
			Tagline               *string  `json:"tagline,omitempty"`
			AudienceRating        *float64 `json:"audienceRating,omitempty"`
			AudienceRatingImage   *string  `json:"audienceRatingImage,omitempty"`
			Subtype               *string  `json:"subtype,omitempty"`
			SkipChildren          *bool    `json:"skipChildren,omitempty"`
		} `json:"Metadata"`
	} `json:"MediaContainer"`
}

type PlexWatchlistDetail

type PlexWatchlistDetail struct {
	MediaContainer struct {
		Offset     int64  `json:"offset"`
		TotalSize  int64  `json:"totalSize"`
		Identifier string `json:"identifier"`
		Size       int64  `json:"size"`
		Metadata   []struct {
			Art                   string     `json:"art"`
			Banner                string     `json:"banner"`
			MetadatumGUID         string     `json:"guid"`
			Key                   string     `json:"key"`
			MetadatumRating       float64    `json:"rating"`
			RatingKey             string     `json:"ratingKey"`
			MetadatumStudio       string     `json:"studio"`
			Summary               string     `json:"summary"`
			Tagline               string     `json:"tagline"`
			Type                  string     `json:"type"`
			Theme                 string     `json:"theme"`
			Thumb                 string     `json:"thumb"`
			AddedAt               int64      `json:"addedAt"`
			Duration              int64      `json:"duration"`
			PublicPagesURL        string     `json:"publicPagesURL"`
			Slug                  string     `json:"slug"`
			UserState             bool       `json:"userState"`
			Title                 string     `json:"title"`
			LeafCount             int64      `json:"leafCount"`
			ChildCount            int64      `json:"childCount"`
			ContentRating         string     `json:"contentRating"`
			OriginallyAvailableAt string     `json:"originallyAvailableAt"`
			Year                  int64      `json:"year"`
			RatingImage           string     `json:"ratingImage"`
			ImdbRatingCount       int64      `json:"imdbRatingCount"`
			Image                 []Image    `json:"Image"`
			Genre                 []Genre    `json:"Genre"`
			GUID                  []GUID     `json:"Guid"`
			Country               []Country  `json:"Country"`
			Role                  []Role     `json:"Role"`
			Director              []Director `json:"Director"`
			Producer              []Director `json:"Producer"`
			Writer                []Director `json:"Writer"`
			Network               []Country  `json:"Network"`
			Rating                []Rating   `json:"Rating"`
			Similar               []Similar  `json:"Similar"`
			Studio                []Country  `json:"Studio"`
		} `json:"Metadata"`
	} `json:"MediaContainer"`
}

type Rating

type Rating struct {
	Image string  `json:"image"`
	Type  string  `json:"type"`
	Value float64 `json:"value"`
}

type Resource

type Resource struct {
	Name             string `json:"name"`
	Product          string `json:"product"`
	ProductVersion   string `json:"productVersion"`
	Platform         string `json:"platform"`
	PlatformVersion  string `json:"platformVersion"`
	Device           string `json:"device"`
	ClientIdentifier string `json:"clientIdentifier"`
	CreatedAt        string `json:"createdAt"`
	LastSeenAt       string `json:"lastSeenAt"`
	Provides         string `json:"provides"`
	// OwnerID                interface{}  `json:"ownerId"`
	// SourceTitle            interface{}  `json:"sourceTitle"`
	PublicAddress          string       `json:"publicAddress"`
	AccessToken            *string      `json:"accessToken"`
	Owned                  bool         `json:"owned"`
	Home                   bool         `json:"home"`
	Synced                 bool         `json:"synced"`
	Relay                  bool         `json:"relay"`
	Presence               bool         `json:"presence"`
	HTTPSRequired          bool         `json:"httpsRequired"`
	PublicAddressMatches   bool         `json:"publicAddressMatches"`
	DNSRebindingProtection *bool        `json:"dnsRebindingProtection,omitempty"`
	NatLoopbackSupported   *bool        `json:"natLoopbackSupported,omitempty"`
	Connections            []Connection `json:"connections"`
}

type Role

type Role struct {
	ID        string  `json:"id"`
	Order     int64   `json:"order"`
	Slug      string  `json:"slug"`
	Tag       string  `json:"tag"`
	Thumb     *string `json:"thumb,omitempty"`
	Role      *string `json:"role,omitempty"`
	Directory bool    `json:"directory"`
}

type SearchMetadata

type SearchMetadata struct {
	LibrarySectionTitle   string     `json:"librarySectionTitle"`
	Score                 string     `json:"score"`
	RatingKey             string     `json:"ratingKey"`
	Key                   string     `json:"key"`
	GUID                  string     `json:"guid"`
	Slug                  *string    `json:"slug,omitempty"`
	Studio                *string    `json:"studio,omitempty"`
	Type                  string     `json:"type"`
	Title                 string     `json:"title"`
	LibrarySectionID      int64      `json:"librarySectionID"`
	LibrarySectionKey     string     `json:"librarySectionKey"`
	ContentRating         string     `json:"contentRating"`
	Summary               string     `json:"summary"`
	Index                 *int64     `json:"index,omitempty"`
	AudienceRating        *float64   `json:"audienceRating,omitempty"`
	ViewCount             *int64     `json:"viewCount,omitempty"`
	LastViewedAt          *int64     `json:"lastViewedAt,omitempty"`
	Year                  *int64     `json:"year,omitempty"`
	Tagline               *string    `json:"tagline,omitempty"`
	Thumb                 string     `json:"thumb"`
	Art                   string     `json:"art"`
	Theme                 *string    `json:"theme,omitempty"`
	Duration              int64      `json:"duration"`
	OriginallyAvailableAt string     `json:"originallyAvailableAt"`
	LeafCount             *int64     `json:"leafCount,omitempty"`
	ViewedLeafCount       *int64     `json:"viewedLeafCount,omitempty"`
	ChildCount            *int64     `json:"childCount,omitempty"`
	AddedAt               int64      `json:"addedAt"`
	UpdatedAt             int64      `json:"updatedAt"`
	AudienceRatingImage   *string    `json:"audienceRatingImage,omitempty"`
	Genre                 []Country  `json:"Genre,omitempty"`
	Country               []Country  `json:"Country,omitempty"`
	Role                  []Country  `json:"Role,omitempty"`
	Location              []Location `json:"Location,omitempty"`
	SkipCount             *int64     `json:"skipCount,omitempty"`
	SeasonCount           *int64     `json:"seasonCount,omitempty"`
	Field                 []Field    `json:"Field,omitempty"`
	Rating                *float64   `json:"rating,omitempty"`
	PrimaryExtraKey       *string    `json:"primaryExtraKey,omitempty"`
	RatingImage           *string    `json:"ratingImage,omitempty"`
	Media                 []Media    `json:"Media,omitempty"`
	Director              []Country  `json:"Director,omitempty"`
	Writer                []Country  `json:"Writer,omitempty"`
	ChapterSource         *string    `json:"chapterSource,omitempty"`
	ParentRatingKey       *string    `json:"parentRatingKey,omitempty"`
	GrandparentRatingKey  *string    `json:"grandparentRatingKey,omitempty"`
	ParentGUID            *string    `json:"parentGuid,omitempty"`
	GrandparentGUID       *string    `json:"grandparentGuid,omitempty"`
	TitleSort             *string    `json:"titleSort,omitempty"`
	GrandparentKey        *string    `json:"grandparentKey,omitempty"`
	ParentKey             *string    `json:"parentKey,omitempty"`
	GrandparentTitle      *string    `json:"grandparentTitle,omitempty"`
	ParentTitle           *string    `json:"parentTitle,omitempty"`
	OriginalTitle         *string    `json:"originalTitle,omitempty"`
	ParentIndex           *int64     `json:"parentIndex,omitempty"`
	ParentYear            *int64     `json:"parentYear,omitempty"`
	ParentThumb           *string    `json:"parentThumb,omitempty"`
	GrandparentThumb      *string    `json:"grandparentThumb,omitempty"`
	GrandparentArt        *string    `json:"grandparentArt,omitempty"`
	GrandparentTheme      *string    `json:"grandparentTheme,omitempty"`
	GrandparentSlug       *string    `json:"grandparentSlug,omitempty"`
}

type Server

type Server struct {
	Title string `json:"title"`
	UUID  string `json:"uuid"`
}

type ServerClient

type ServerClient struct {
	Name                 string `json:"name"`
	Host                 string `json:"host"`
	Address              string `json:"address"`
	Port                 int64  `json:"port"`
	MachineIdentifier    string `json:"machineIdentifier"`
	Version              string `json:"version"`
	Protocol             string `json:"protocol"`
	Product              string `json:"product"`
	DeviceClass          string `json:"deviceClass"`
	ProtocolVersion      string `json:"protocolVersion"`
	ProtocolCapabilities string `json:"protocolCapabilities"`
}

type Session

type Session struct {
	ID        string `json:"id"`
	Bandwidth int64  `json:"bandwidth"`
	Location  string `json:"location"`
}

type SessionMedia

type SessionMedia struct {
	AudioProfile          string         `json:"audioProfile"`
	ID                    string         `json:"id"`
	VideoProfile          string         `json:"videoProfile"`
	AudioChannels         int64          `json:"audioChannels"`
	AudioCodec            string         `json:"audioCodec"`
	Bitrate               int64          `json:"bitrate"`
	Container             string         `json:"container"`
	Duration              int64          `json:"duration"`
	Height                int64          `json:"height"`
	OptimizedForStreaming bool           `json:"optimizedForStreaming"`
	Protocol              string         `json:"protocol"`
	VideoCodec            string         `json:"videoCodec"`
	VideoFrameRate        string         `json:"videoFrameRate"`
	VideoResolution       string         `json:"videoResolution"`
	Width                 int64          `json:"width"`
	Selected              bool           `json:"selected"`
	Part                  []*SessionPart `json:"Part"`
}

type SessionPart

type SessionPart struct {
	AudioProfile          string    `json:"audioProfile"`
	ID                    string    `json:"id"`
	VideoProfile          string    `json:"videoProfile"`
	Bitrate               int64     `json:"bitrate"`
	Container             string    `json:"container"`
	Duration              int64     `json:"duration"`
	Height                int64     `json:"height"`
	OptimizedForStreaming bool      `json:"optimizedForStreaming"`
	Protocol              string    `json:"protocol"`
	Width                 int64     `json:"width"`
	Decision              string    `json:"decision"`
	Selected              bool      `json:"selected"`
	Stream                []*Stream `json:"Stream"`
}

type SessionPlayer

type SessionPlayer struct {
	Address             string `json:"address"`
	Device              string `json:"device"`
	MachineIdentifier   string `json:"machineIdentifier"`
	Model               string `json:"model"`
	Platform            string `json:"platform"`
	PlatformVersion     string `json:"platformVersion"`
	Product             string `json:"product"`
	Profile             string `json:"profile"`
	RemotePublicAddress string `json:"remotePublicAddress"`
	State               string `json:"state"`
	Title               string `json:"title"`
	Version             string `json:"version"`
	Local               bool   `json:"local"`
	Relayed             bool   `json:"relayed"`
	Secure              bool   `json:"secure"`
	UserID              int64  `json:"userID"`
}

type Similar

type Similar struct {
	GUID string `json:"guid"`
	Tag  string `json:"tag"`
}

type Stream

type Stream struct {
	Bitrate              int64    `json:"bitrate"`
	Codec                string   `json:"codec"`
	Default              bool     `json:"default"`
	DisplayTitle         string   `json:"displayTitle"`
	ExtendedDisplayTitle string   `json:"extendedDisplayTitle"`
	FrameRate            *float64 `json:"frameRate,omitempty"`
	Height               *int64   `json:"height,omitempty"`
	ID                   string   `json:"id"`
	Language             string   `json:"language"`
	LanguageCode         string   `json:"languageCode"`
	LanguageTag          string   `json:"languageTag"`
	StreamType           int64    `json:"streamType"`
	Width                *int64   `json:"width,omitempty"`
	Decision             string   `json:"decision"`
	Location             string   `json:"location"`
	AudioChannelLayout   *string  `json:"audioChannelLayout,omitempty"`
	BitrateMode          *string  `json:"bitrateMode,omitempty"`
	Channels             *int64   `json:"channels,omitempty"`
	Profile              *string  `json:"profile,omitempty"`
	SamplingRate         *int64   `json:"samplingRate,omitempty"`
	Selected             *bool    `json:"selected,omitempty"`
	Burn                 *string  `json:"burn,omitempty"`
	Title                *string  `json:"title,omitempty"`
}

type Style

type Style string
const (
	Shelf Style = "shelf"
)

type TranscodeSession

type TranscodeSession struct {
	Key                      string  `json:"key"`
	Throttled                bool    `json:"throttled"`
	Complete                 bool    `json:"complete"`
	Progress                 float64 `json:"progress"`
	Size                     int64   `json:"size"`
	Speed                    float64 `json:"speed"`
	Error                    bool    `json:"error"`
	Duration                 int64   `json:"duration"`
	Remaining                int64   `json:"remaining"`
	Context                  string  `json:"context"`
	SourceVideoCodec         string  `json:"sourceVideoCodec"`
	SourceAudioCodec         string  `json:"sourceAudioCodec"`
	VideoDecision            string  `json:"videoDecision"`
	AudioDecision            string  `json:"audioDecision"`
	SubtitleDecision         string  `json:"subtitleDecision"`
	Protocol                 string  `json:"protocol"`
	Container                string  `json:"container"`
	VideoCodec               string  `json:"videoCodec"`
	AudioCodec               string  `json:"audioCodec"`
	AudioChannels            int64   `json:"audioChannels"`
	TranscodeHwRequested     bool    `json:"transcodeHwRequested"`
	TranscodeHwDecoding      string  `json:"transcodeHwDecoding"`
	TranscodeHwEncoding      string  `json:"transcodeHwEncoding"`
	TranscodeHwDecodingTitle string  `json:"transcodeHwDecodingTitle"`
	TranscodeHwFullPipeline  bool    `json:"transcodeHwFullPipeline"`
	TranscodeHwEncodingTitle string  `json:"transcodeHwEncodingTitle"`
	TimeStamp                float64 `json:"timeStamp"`
	MaxOffsetAvailable       float64 `json:"maxOffsetAvailable"`
	MinOffsetAvailable       float64 `json:"minOffsetAvailable"`
}

type User

type User struct {
	ID    string `json:"id"`
	Thumb string `json:"thumb"`
	Title string `json:"title"`
}

type WatchlistOpts

type WatchlistOpts struct {
	Filter string // all, or ???
	Sort   string // ???
	Type   string // library type? movie, show, episode, artist, album, track?
}

Jump to

Keyboard shortcuts

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