mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add watch history
This commit is contained in:
parent
08c46e50bb
commit
cf35596985
3 changed files with 55 additions and 13 deletions
12
episode.go
12
episode.go
|
|
@ -75,6 +75,18 @@ type Episode struct {
|
|||
StreamID string
|
||||
}
|
||||
|
||||
// HistoryEpisode contains additional information about an episode if the account has watched or started to watch the episode.
|
||||
type HistoryEpisode struct {
|
||||
*Episode
|
||||
|
||||
ID string `json:"id"`
|
||||
DatePlayed string `json:"date_played"`
|
||||
ParentID string `json:"parent_id"`
|
||||
ParentType MediaType `json:"parent_type"`
|
||||
Playhead uint `json:"playhead"`
|
||||
FullyWatched bool `json:"fully_watched"`
|
||||
}
|
||||
|
||||
// EpisodeFromID returns an episode by its api id.
|
||||
func EpisodeFromID(crunchy *Crunchyroll, id string) (*Episode, error) {
|
||||
resp, err := crunchy.request(fmt.Sprintf("https://beta-api.crunchyroll.com/cms/v2/%s/%s/%s/episodes/%s?locale=%s&Signature=%s&Policy=%s&Key-Pair-Id=%s",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue