-
-
Notifications
You must be signed in to change notification settings - Fork 313
Expand file tree
/
Copy pathfeed.go
More file actions
81 lines (70 loc) · 2.77 KB
/
Copy pathfeed.go
File metadata and controls
81 lines (70 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package model
import (
"time"
)
// 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")
FormatCustom = Format("custom")
)
// Playlist sorting style
type Sorting string
const (
SortingDesc = Sorting("desc")
SortingAsc = Sorting("asc")
)
type Episode struct {
// ID of episode
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
}
type Feed struct {
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"`
CoverArtQuality Quality `json:"cover_art_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"`
PlaylistSort Sorting `json:"playlist_sort"`
PrivateFeed bool `json:"private_feed"`
// ScannedThrough is the oldest publish date discovery has paged back to. It is a high-water
// mark used to decide when max_age has been expanded beyond what was ever scanned, so a deep
// (max_age-driven) discovery pass is only triggered once per expansion instead of every cycle.
ScannedThrough time.Time `json:"scanned_through"`
}
type EpisodeStatus string
const (
EpisodeNew = EpisodeStatus("new") // New episode received via API
EpisodeDownloaded = EpisodeStatus("downloaded") // Downloaded, encoded and available for download
EpisodeError = EpisodeStatus("error") // Could not download, will retry
EpisodeCleaned = EpisodeStatus("cleaned") // Downloaded and later removed from disk due to update strategy
)