2017-08-10 15:23:07 -07:00
|
|
|
package api
|
2017-07-22 22:08:38 -07:00
|
|
|
|
2017-07-31 21:51:21 -07:00
|
|
|
import "time"
|
|
|
|
|
2017-08-13 14:50:59 -07:00
|
|
|
type Provider string
|
|
|
|
|
|
|
|
const (
|
|
|
|
Youtube = Provider("youtube")
|
|
|
|
Vimeo = Provider("vimeo")
|
|
|
|
)
|
|
|
|
|
|
|
|
type LinkType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
Channel = LinkType("channel")
|
|
|
|
Playlist = LinkType("playlist")
|
|
|
|
User = LinkType("user")
|
|
|
|
Group = LinkType("group")
|
|
|
|
)
|
|
|
|
|
2017-07-22 22:08:38 -07:00
|
|
|
type Quality string
|
|
|
|
|
|
|
|
const (
|
|
|
|
HighQuality = Quality("high")
|
|
|
|
LowQuality = Quality("low")
|
2017-08-13 14:50:59 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type Format string
|
|
|
|
|
|
|
|
const (
|
2017-07-22 22:08:38 -07:00
|
|
|
AudioFormat = Format("audio")
|
|
|
|
VideoFormat = Format("video")
|
|
|
|
)
|
|
|
|
|
2017-08-11 12:49:56 -07:00
|
|
|
const (
|
|
|
|
DefaultPageSize = 50
|
|
|
|
DefaultFormat = VideoFormat
|
|
|
|
DefaultQuality = HighQuality
|
|
|
|
)
|
|
|
|
|
2017-07-22 22:08:38 -07:00
|
|
|
type Feed struct {
|
2017-08-13 14:50:59 -07:00
|
|
|
Id int64 `json:"id"`
|
|
|
|
HashId string `json:"hash_id"` // Short human readable feed id for users
|
|
|
|
UserId string `json:"user_id"` // Patreon user id
|
|
|
|
ItemId string `json:"item_id"`
|
|
|
|
Provider Provider `json:"provider"` // Youtube or Vimeo
|
|
|
|
LinkType LinkType `json:"link_type"` // Either group, channel or user
|
|
|
|
PageSize int `json:"page_size"` // The number of episodes to return
|
|
|
|
Format Format `json:"format"`
|
|
|
|
Quality Quality `json:"quality"`
|
|
|
|
FeatureLevel int `json:"feature_level"` // Available features
|
|
|
|
LastAccess time.Time `json:"last_access"`
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
DefaultFeatures = iota
|
|
|
|
ExtendedFeatures
|
|
|
|
PodcasterFeature
|
|
|
|
)
|
|
|
|
|
|
|
|
type CreateFeedRequest struct {
|
|
|
|
URL string `json:"url"`
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
Quality Quality `json:"quality"`
|
|
|
|
Format Format `json:"format"`
|
2017-07-22 22:08:38 -07:00
|
|
|
}
|