2019-10-29 14:38:29 -07:00
|
|
|
package model
|
2019-10-29 12:50:06 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2019-10-29 14:38:29 -07:00
|
|
|
// Quality to use when downloading episodes
|
|
|
|
type Quality string
|
|
|
|
|
|
|
|
const (
|
|
|
|
QualityHigh = Quality("high")
|
|
|
|
QualityLow = Quality("low")
|
|
|
|
)
|
|
|
|
|
|
|
|
// Format to convert episode when downloading episodes
|
|
|
|
type Format string
|
|
|
|
|
|
|
|
const (
|
|
|
|
FormatAudio = Format("audio")
|
|
|
|
FormatVideo = Format("video")
|
|
|
|
)
|
|
|
|
|
|
|
|
type Episode struct {
|
2019-10-29 12:50:06 -07:00
|
|
|
// ID of episode
|
2020-01-25 15:58:41 -08:00
|
|
|
ID string `json:"id"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Thumbnail string `json:"thumbnail"`
|
|
|
|
Duration int64 `json:"duration"`
|
|
|
|
VideoURL string `json:"video_url"`
|
|
|
|
PubDate time.Time `json:"pub_date"`
|
|
|
|
Size int64 `json:"size"`
|
|
|
|
Order string `json:"order"`
|
|
|
|
Status EpisodeStatus `json:"status"` // Disk status
|
2019-10-29 12:50:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type Feed struct {
|
2020-04-18 14:52:15 -07:00
|
|
|
ID string `json:"feed_id"`
|
|
|
|
ItemID string `json:"item_id"`
|
|
|
|
LinkType Type `json:"link_type"` // Either group, channel or user
|
|
|
|
Provider Provider `json:"provider"` // Youtube or Vimeo
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
LastAccess time.Time `json:"last_access"`
|
|
|
|
ExpirationTime time.Time `json:"expiration_time"`
|
|
|
|
Format Format `json:"format"`
|
|
|
|
Quality Quality `json:"quality"`
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
CoverArt string `json:"cover_art"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
PubDate time.Time `json:"pub_date"`
|
|
|
|
Author string `json:"author"`
|
|
|
|
ItemURL string `json:"item_url"` // Platform specific URL
|
|
|
|
Episodes []*Episode `json:"-"` // Array of episodes
|
|
|
|
UpdatedAt time.Time `json:"updated_at"`
|
2019-10-29 12:50:06 -07:00
|
|
|
}
|
2019-12-01 14:08:54 -08:00
|
|
|
|
|
|
|
type EpisodeStatus string
|
|
|
|
|
|
|
|
const (
|
|
|
|
EpisodeNew = EpisodeStatus("new") // New episode received via API
|
|
|
|
EpisodeDownloaded = EpisodeStatus("downloaded") // Downloaded, encoded and available for download
|
2019-12-01 15:19:08 -08:00
|
|
|
EpisodeError = EpisodeStatus("error") // Could not download, will retry
|
2019-12-01 14:08:54 -08:00
|
|
|
EpisodeCleaned = EpisodeStatus("cleaned") // Downloaded and later removed from disk due to update strategy
|
|
|
|
)
|