From 3ee5f7a538b1f51c4cc051586148737890b3b64a Mon Sep 17 00:00:00 2001 From: bytedream Date: Tue, 15 Mar 2022 13:41:39 +0100 Subject: [PATCH] Added ids to ...FromID functions (how did this work before??) --- episode.go | 1 + movie_listing.go | 1 + season.go | 1 + video.go | 2 ++ 4 files changed, 5 insertions(+) diff --git a/episode.go b/episode.go index 6ab330b..d9814cb 100644 --- a/episode.go +++ b/episode.go @@ -94,6 +94,7 @@ func EpisodeFromID(crunchy *Crunchyroll, id string) (*Episode, error) { episode := &Episode{ crunchy: crunchy, + ID: id, } if err := decodeMapToStruct(jsonBody, episode); err != nil { return nil, err diff --git a/movie_listing.go b/movie_listing.go index cab4e9d..9646c18 100644 --- a/movie_listing.go +++ b/movie_listing.go @@ -56,6 +56,7 @@ func MovieListingFromID(crunchy *Crunchyroll, id string) (*MovieListing, error) movieListing := &MovieListing{ crunchy: crunchy, + ID: id, } if err = decodeMapToStruct(jsonBody, movieListing); err != nil { return nil, err diff --git a/season.go b/season.go index 438236d..c9a17da 100644 --- a/season.go +++ b/season.go @@ -61,6 +61,7 @@ func SeasonFromID(crunchy *Crunchyroll, id string) (*Season, error) { season := &Season{ crunchy: crunchy, + ID: id, } if err := decodeMapToStruct(jsonBody, season); err != nil { return nil, err diff --git a/video.go b/video.go index 1b83c90..f543df1 100644 --- a/video.go +++ b/video.go @@ -86,6 +86,7 @@ func MovieFromID(crunchy *Crunchyroll, id string) (*Movie, error) { movieListing := &Movie{ crunchy: crunchy, } + movieListing.ID = id if err = decodeMapToStruct(jsonBody, movieListing); err != nil { return nil, err } @@ -182,6 +183,7 @@ func SeriesFromID(crunchy *Crunchyroll, id string) (*Series, error) { series := &Series{ crunchy: crunchy, } + series.ID = id if err = decodeMapToStruct(jsonBody, series); err != nil { return nil, err }