-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress.go
71 lines (57 loc) · 1.66 KB
/
progress.go
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
package trakt
import "time"
type ActivityType string
const (
ActivityTypeAired ActivityType = "aired"
ActivityTypeWatched ActivityType = "watched"
)
type ProgressParams struct {
Params
Hidden bool `json:"-" url:"hidden,omitempty"`
Specials bool `json:"-" url:"specials,omitempty"`
CountSpecials bool `json:"-" url:"count_specials,omitempty"`
LastActivity ActivityType `json:"-" url:"last_activity,omitempty"`
}
type progress struct {
Aired int64 `json:"aired"`
Watched int64 `json:"completed"`
// HiddenSeasons *Season
NextEpisode *Episode `json:"next_episode"`
LastEpisode *Episode `json:"last_episode"`
}
type CollectedProgress struct {
progress
Seasons []*CollectedSeasonProgress `json:"seasons"`
CollectedAt time.Time `json:"last_collected_at"`
}
type WatchedProgress struct {
progress
Seasons []*WatchedSeasonProgress `json:"seasons"`
WatchedAt time.Time `json:"last_watched_at"`
ResetAt time.Time `json:"reset_at"`
}
type seasonProgress struct {
Number int64 `json:"number"`
Aired int64 `json:"aired"`
Watched int64 `json:"completed"`
}
type WatchedSeasonProgress struct {
seasonProgress
Episodes []*WatchedEpisodeProgress `json:"episodes"`
}
type CollectedSeasonProgress struct {
seasonProgress
Episodes []*CollectedEpisodeProgress `json:"episodes"`
}
type episodeProgress struct {
Number int64 `json:"number"`
Watched bool `json:"completed"`
}
type WatchedEpisodeProgress struct {
episodeProgress
WatchedAt time.Time `json:"watched_at"`
}
type CollectedEpisodeProgress struct {
episodeProgress
CollectedAt time.Time `json:"collected_at"`
}