96 lines
3.3 KiB
Go
96 lines
3.3 KiB
Go
package main
|
|
|
|
// webhookEvent is an incoming plex event
|
|
// this struct was autogenerated so may not be suitable for all
|
|
// events
|
|
type webhookEvent struct {
|
|
Event string `json:"event"`
|
|
User bool `json:"user"`
|
|
Owner bool `json:"owner"`
|
|
Account struct {
|
|
ID int `json:"id"`
|
|
Thumb string `json:"thumb"`
|
|
Title string `json:"title"`
|
|
} `json:"Account"`
|
|
Server struct {
|
|
Title string `json:"title"`
|
|
UUID string `json:"uuid"`
|
|
} `json:"Server"`
|
|
Player struct {
|
|
Local bool `json:"local"`
|
|
PublicAddress string `json:"publicAddress"`
|
|
Title string `json:"title"`
|
|
UUID string `json:"uuid"`
|
|
} `json:"Player"`
|
|
Metadata 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"`
|
|
ParentGUID string `json:"parentGuid"`
|
|
GrandparentGUID string `json:"grandparentGuid"`
|
|
ParentStudio string `json:"parentStudio"`
|
|
Type string `json:"type"`
|
|
Title string `json:"title"`
|
|
GrandparentKey string `json:"grandparentKey"`
|
|
ParentKey string `json:"parentKey"`
|
|
LibrarySectionTitle string `json:"librarySectionTitle"`
|
|
LibrarySectionID int `json:"librarySectionID"`
|
|
LibrarySectionKey string `json:"librarySectionKey"`
|
|
GrandparentTitle string `json:"grandparentTitle"`
|
|
ParentTitle string `json:"parentTitle"`
|
|
Summary string `json:"summary"`
|
|
Index int `json:"index"`
|
|
ParentIndex int `json:"parentIndex"`
|
|
RatingCount int `json:"ratingCount"`
|
|
ViewCount int `json:"viewCount"`
|
|
LastViewedAt int `json:"lastViewedAt"`
|
|
ParentYear int `json:"parentYear"`
|
|
Thumb string `json:"thumb"`
|
|
Art string `json:"art"`
|
|
ParentThumb string `json:"parentThumb"`
|
|
GrandparentThumb string `json:"grandparentThumb"`
|
|
GrandparentArt string `json:"grandparentArt"`
|
|
AddedAt int `json:"addedAt"`
|
|
UpdatedAt int `json:"updatedAt"`
|
|
MusicAnalysisVersion string `json:"musicAnalysisVersion"`
|
|
Image []struct {
|
|
Alt string `json:"alt"`
|
|
Type string `json:"type"`
|
|
URL string `json:"url"`
|
|
} `json:"Image"`
|
|
Genre []struct {
|
|
ID int `json:"id"`
|
|
Filter string `json:"filter"`
|
|
Tag string `json:"tag"`
|
|
} `json:"Genre"`
|
|
GUID0 []struct {
|
|
ID string `json:"id"`
|
|
} `json:"Guid"`
|
|
Mood []struct {
|
|
ID int `json:"id"`
|
|
Filter string `json:"filter"`
|
|
Tag string `json:"tag"`
|
|
} `json:"Mood"`
|
|
} `json:"Metadata"`
|
|
}
|
|
|
|
// lbListen is the payload for a listenbrainz listen submission
|
|
type lbListen struct {
|
|
ListenType string `json:"listen_type"`
|
|
Payload []lbListenPayload `json:"payload"`
|
|
}
|
|
|
|
type lbListenPayload struct {
|
|
ListenedAt int64 `json:"listened_at"`
|
|
TrackMetadata lbTrackMetadata `json:"track_metadata"`
|
|
}
|
|
|
|
type lbTrackMetadata struct {
|
|
ArtistName string `json:"artist_name"`
|
|
TrackName string `json:"track_name"`
|
|
ReleaseName string `json:"release_name"`
|
|
}
|