Documentation ¶
Index ¶
- func Extract(mpr *multipart.Reader) (payload *Payload, thumbnail *Thumbnail, err error)
- type Account
- type EventType
- type LibrarySection
- type MediaSubType
- type MediaType
- type Metadata
- type MetadataGUID
- type MetadataItem
- type MetadataItemField
- type MetadataItemRole
- type MetadataRating
- type Payload
- type Player
- type Server
- type Thumbnail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { ID int `json:"id"` // server relative id (owner is 1) Thumb *url.URL Title string `json:"title"` // username }
Account represent the account which has generated the wehhook launch on the server
func (*Account) UnmarshalJSON ¶
UnmarshalJSON allows to convert json values to Go types
type EventType ¶
type EventType string
EventType represent the webhook event type
const ( // EventTypePause represents the play event EventTypePause EventType = "media.pause" // EventTypePlay represents the play event EventTypePlay EventType = "media.play" // EventTypeRate represents the rate event EventTypeRate EventType = "media.rate" // EventTypeResume represents the resume event EventTypeResume EventType = "media.resume" // EventTypeScrobble represents the scrobble event EventTypeScrobble EventType = "media.scrobble" // EventTypeStop represents the stop event EventTypeStop EventType = "media.stop" )
type LibrarySection ¶
type LibrarySection string
LibrarySection represents the of the library section
const ( // LibrarySectionShow represents the shows library type LibrarySectionShow LibrarySection = "show" // LibrarySectionMusic represents the music library type LibrarySectionMusic LibrarySection = "artist" // LibrarySectionMovie represents the movies library type LibrarySectionMovie LibrarySection = "movie" )
type MediaSubType ¶ added in v1.0.0
type MediaSubType string
MediaSubType represente the subtype of media related to the webhook event
const ( // MediaSubTypeMovie represents the media sub type for a trailer MediaSubTypeMovie MediaSubType = "trailer" // MediaSubTypeBehindTheScenes represents the media sub type for a behind the scenes clip MediaSubTypeBehindTheScenes MediaSubType = "behindTheScenes" )
type MediaType ¶
type MediaType string
MediaType represente the type of media related to the webhook event
const ( // MediaTypeMovie represents the media type for a movie MediaTypeMovie MediaType = "movie" // MediaTypeEpisode represents the media type for a show episode MediaTypeEpisode MediaType = "episode" // MediaTypeTrack represents the media type for an audio track MediaTypeTrack MediaType = "track" // MediaTypeClip represents the media type for a clip MediaTypeClip MediaType = "clip" // MediaTypePhoto represents the media type for a photo MediaTypePhoto MediaType = "photo" )
type Metadata ¶
type Metadata struct { AddedAt time.Time `json:"addedAt"` // movie + show + music Art string `json:"art"` // movie + show AttributionLogo *url.URL `json:"attributionLogo"` // streaming movie AudienceRating float64 `json:"audienceRating"` // movie AudienceRatingImage string `json:"audienceRatingImage"` // movie Banner *url.URL `json:"banner"` // movie Channel []MetadataItem `json:"Channel"` // tv movie ChapterSource string `json:"chapterSource"` // show (movie too ?) Collection []MetadataItem `json:"Collection"` // movie ContentRating string `json:"contentRating"` // movie + show Country []MetadataItem `json:"Country"` // movie CreatedAtAccuracy string `json:"createdAtAccuracy"` // photo CreatedAtTZOffset string `json:"createdAtTZOffset"` // photo Director []MetadataItem `json:"Director"` // movie + show Duration time.Duration `json:"duration"` // movie Field []MetadataItemField `json:"Field"` // tv movie Genre []MetadataItem `json:"Genre"` // movie GenuineMediaAnalysis string `json:"genuineMediaAnalysis"` // show GrandparentArt string `json:"grandparentArt"` // show GrandparentKey string `json:"grandparentKey"` // music GrandparentRatingKey string `json:"grandparentRatingKey"` // show + music GrandparentTheme string `json:"grandparentTheme"` // show GrandparentThumb string `json:"grandparentThumb"` // show + music GrandparentTitle string `json:"grandparentTitle"` // music GUID *url.URL `json:"guid"` // movie + show + music GUIDExternal []*url.URL `json:"Guid"` // movie + show Index int `json:"index"` // show + music Indirect bool `json:"indirect"` // movie Key string `json:"key"` // movie + show + music LastRatedAt time.Time `json:"lastRatedAt"` // movie + show + music LastViewedAt time.Time `json:"lastViewedAt"` // movie + show + music LibrarySectionID int `json:"librarySectionID"` // movie + show + music LibrarySectionKey string `json:"librarySectionKey"` // movie + show + music LibrarySectionTitle string `json:"librarySectionTitle"` // movie + show + music LibrarySectionType LibrarySection `json:"librarySectionType"` // movie + show + music Live string `json:"live"` // show Mood []MetadataItem `json:"Mood"` // music OneShot string `json:"oneShot"` // tv movie OriginallyAvailableAt time.Time `json:"originallyAvailableAt"` // movie OriginalTitle string `json:"originalTitle"` // music ParentArt string `json:"parentArt"` // show ParentIndex int `json:"parentIndex"` // show + music ParentKey string `json:"parentKey"` // music ParentRatingKey string `json:"parentRatingKey"` // show + music ParentThumb string `json:"parentThumb"` // show + music ParentTitle string `json:"parentTitle"` // music ParentYear int `json:"parentYear"` // music PrimaryExtraKey string `json:"primaryExtraKey"` // movie Producer []MetadataItem `json:"Producer"` // movie Rating float64 `json:"rating"` // movie + show RatingCount int `json:"ratingCount"` // music RatingImage string `json:"ratingImage"` // movie RatingKey string `json:"ratingKey"` // movie + show + music Ratings []MetadataRating `json:"Rating"` // movie + show Role []MetadataItemRole `json:"Role"` // movie Similar []MetadataItem `json:"Similar"` // movie Studio string `json:"studio"` // movie SubType MediaSubType `json:"subtype"` // clip Summary string `json:"summary"` // movie + show + music Tagline string `json:"tagline"` // movie Thumb string `json:"thumb"` // movie + show + music Title string `json:"title"` // movie + show + music TitleSort string `json:"titleSort"` // show (should be movie too) Type MediaType `json:"type"` // movie + show + music UpdatedAt time.Time `json:"updatedAt"` // movie + show + music UserRating float64 `json:"userRating"` // movie ViewCount int `json:"viewCount"` // movie + show + music ViewOffset int `json:"viewOffset"` // movie Writer []MetadataItem `json:"Writer"` // movie + show Year int `json:"year"` // movie + show }
Metadata represents all the metadata associated with a media sent by the webhook
func (*Metadata) UnmarshalJSON ¶
UnmarshalJSON allows to convert json values to Go types
type MetadataGUID ¶ added in v1.1.0
type MetadataGUID struct {
ID string `json:"id"`
}
MetadataGUID represents a ref to third-party ids, i.e. imdb and tmdb
type MetadataItem ¶
type MetadataItem struct { ID int `json:"id"` Filter string `json:"filter"` Tag string `json:"tag"` Count int `json:"count"` }
MetadataItem represents a ref to an external entity
type MetadataItemField ¶ added in v1.0.0
MetadataItemField represents a ref to a Metadata.Field entity
type MetadataItemRole ¶
type MetadataItemRole struct { MetadataItem Role string `json:"role"` Thumb *url.URL }
MetadataItemRole is a specialisation for roles of MetadataItem
func (*MetadataItemRole) UnmarshalJSON ¶
func (mir *MetadataItemRole) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON allows to convert json values to Go types
type MetadataRating ¶ added in v1.2.0
type MetadataRating struct { Image string `json:"image"` Value float64 `json:"value"` Type string `json:"type"` }
MetadataRating represents a rating provided by a user.
type Payload ¶
type Payload struct { Rating int // only present for Event == EventTypeRate Event EventType `json:"event"` User bool `json:"user"` Owner bool `json:"owner"` Account Account `json:"Account"` Server Server `json:"Server"` Player Player `json:"Player"` Metadata Metadata `json:"Metadata"` }
Payload represents the base structure for all plex webhooks
func (*Payload) UnmarshalJSON ¶
UnmarshalJSON allows to convert json values to Go types
type Player ¶
type Player struct { Local bool `json:"local"` PublicAddress net.IP Title string `json:"title"` UUID string `json:"uuid"` }
Player holds informations about the user's player
func (*Player) UnmarshalJSON ¶
UnmarshalJSON allows to convert json values to Go types