From 6f842d0bcfdf503815ed8089b3d01377b58aa32a Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:05:09 -0500 Subject: [PATCH 01/11] Extract TVSeasonImage struct --- tv_seasons.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tv_seasons.go b/tv_seasons.go index 001caa9..02b8d8f 100644 --- a/tv_seasons.go +++ b/tv_seasons.go @@ -236,18 +236,21 @@ func (c *Client) GetTVSeasonExternalIDs( return &tvSeasonExternalIDs, nil } +// TVSeasonImage type is a struct for a single image. +type TVSeasonImage struct { + AspectRatio float32 `json:"aspect_ratio"` + FilePath string `json:"file_path"` + Height int `json:"height"` + Iso639_1 string `json:"iso_639_1"` + VoteAverage float32 `json:"vote_average"` + VoteCount int64 `json:"vote_count"` + Width int `json:"width"` +} + // TVSeasonImages type is a struct for images JSON response. type TVSeasonImages struct { - ID int64 `json:"id,omitempty"` - Posters []struct { - AspectRatio float32 `json:"aspect_ratio"` - FilePath string `json:"file_path"` - Height int `json:"height"` - Iso639_1 string `json:"iso_639_1"` - VoteAverage float32 `json:"vote_average"` - VoteCount int64 `json:"vote_count"` - Width int `json:"width"` - } `json:"posters"` + ID int64 `json:"id,omitempty"` + Logos []TVSeasonImage `json:"posters"` } // GetTVSeasonImages get the images that belong to a TV season. From 2b3bd2171d3a110a657403633906c62a88259dfa Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:05:15 -0500 Subject: [PATCH 02/11] Extract TVEpisodeImage struct --- tv_episodes.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tv_episodes.go b/tv_episodes.go index 84d704b..5a6356b 100644 --- a/tv_episodes.go +++ b/tv_episodes.go @@ -252,18 +252,21 @@ func (c *Client) GetTVEpisodeExternalIDs( return &tvEpisodeExternalIDs, nil } +// TVEpisodeImage type is a struct for a single image. +type TVEpisodeImage struct { + AspectRatio float32 `json:"aspect_ratio"` + FilePath string `json:"file_path"` + Height int `json:"height"` + Iso6391 interface{} `json:"iso_639_1"` + VoteAverage float32 `json:"vote_average"` + VoteCount int64 `json:"vote_count"` + Width int `json:"width"` +} + // TVEpisodeImages type is a struct for images JSON response. type TVEpisodeImages struct { - ID int64 `json:"id,omitempty"` - Stills []struct { - AspectRatio float32 `json:"aspect_ratio"` - FilePath string `json:"file_path"` - Height int `json:"height"` - Iso6391 interface{} `json:"iso_639_1"` - VoteAverage float32 `json:"vote_average"` - VoteCount int64 `json:"vote_count"` - Width int `json:"width"` - } `json:"stills"` + ID int64 `json:"id,omitempty"` + Stills []TVEpisodeImages `json:"stills"` } // GetTVEpisodeImages get the images that belong to a TV episode. From e4838c58f1e8c871835c82e512203a12c8e0ba0d Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:05:26 -0500 Subject: [PATCH 03/11] Extract PersonImage struct --- people.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/people.go b/people.go index d713c44..e685aa6 100644 --- a/people.go +++ b/people.go @@ -388,18 +388,21 @@ func (c *Client) GetPersonExternalIDs( return &personExternalIDS, nil } +// PersonImage type is a struct for a single image. +type PersonImage struct { + Iso639_1 string `json:"iso_639_1"` + Width int `json:"width"` + Height int `json:"height"` + VoteCount int64 `json:"vote_count"` + VoteAverage float32 `json:"vote_average"` + FilePath string `json:"file_path"` + AspectRatio float32 `json:"aspect_ratio"` +} + // PersonImages type is a struct for images JSON response. type PersonImages struct { - Profiles []struct { - Iso639_1 string `json:"iso_639_1"` - Width int `json:"width"` - Height int `json:"height"` - VoteCount int64 `json:"vote_count"` - VoteAverage float32 `json:"vote_average"` - FilePath string `json:"file_path"` - AspectRatio float32 `json:"aspect_ratio"` - } `json:"profiles"` - ID int `json:"id,omitempty"` + LogoProfiless []PersonImage `json:"profiles"` + ID int `json:"id,omitempty"` } // GetPersonImages get the images for a person. From 7d7c0eb30d4d6af12e3a352268195dc3b7bafd30 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:05:35 -0500 Subject: [PATCH 04/11] Extract NetworkImage struct --- networks.go | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/networks.go b/networks.go index 0cba448..b104b4b 100644 --- a/networks.go +++ b/networks.go @@ -61,19 +61,22 @@ func (c *Client) GetNetworkAlternativeNames( return &networkAltenativeNames, nil } +// NetworkImage type is a struct for a single image. +type NetworkImage struct { + AspectRatio float64 `json:"aspect_ratio"` + FilePath string `json:"file_path"` + Height int `json:"height"` + ID string `json:"id"` + FileType string `json:"file_type"` + VoteAverage float64 `json:"vote_average"` + VoteCount int64 `json:"vote_count"` + Width int `json:"width"` +} + // NetworkImages type is a struct for images JSON response. type NetworkImages struct { - ID int64 `json:"id"` - Logos []struct { - AspectRatio float64 `json:"aspect_ratio"` - FilePath string `json:"file_path"` - Height int `json:"height"` - ID string `json:"id"` - FileType string `json:"file_type"` - VoteAverage float64 `json:"vote_average"` - VoteCount int64 `json:"vote_count"` - Width int `json:"width"` - } `json:"logos"` + ID int64 `json:"id"` + Logos []NetworkImage `json:"logos"` } // GetNetworkImages get the TV network logos by id. @@ -86,8 +89,6 @@ type NetworkImages struct { // An SVG can be scaled properly beyond those dimensions if you // call them as a PNG. // -// -// // https://developers.themoviedb.org/3/networks/get-network-images func (c *Client) GetNetworkImages( id int, From bc7e23cd591b09f1e2d40fc0acf20ffd117e4eb5 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:05:48 -0500 Subject: [PATCH 05/11] Extract CompanyImage struct --- companies.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/companies.go b/companies.go index 1e2fd61..b0857af 100644 --- a/companies.go +++ b/companies.go @@ -67,19 +67,22 @@ func (c *Client) GetCompanyAlternativeNames( return &companyAlternativeNames, nil } +// CompanyImage type is a struct for a single image. +type CompanyImage struct { + AspectRatio float32 `json:"aspect_ratio"` + FilePath string `json:"file_path"` + Height int `json:"height"` + ID string `json:"id"` + FileType string `json:"file_type"` + VoteAverage float32 `json:"vote_average"` + VoteCount int64 `json:"vote_count"` + Width int `json:"width"` +} + // CompanyImages type is a struct for images JSON response. type CompanyImages struct { - ID int64 `json:"id"` - Logos []struct { - AspectRatio float32 `json:"aspect_ratio"` - FilePath string `json:"file_path"` - Height int `json:"height"` - ID string `json:"id"` - FileType string `json:"file_type"` - VoteAverage float32 `json:"vote_average"` - VoteCount int64 `json:"vote_count"` - Width int `json:"width"` - } `json:"logos"` + ID int64 `json:"id"` + Logos []CompanyImage `json:"logos"` } // GetCompanyImages get a companies logos by id. From 58e04eae5162e77ed895d00c2467e7607c2b0e77 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:06:17 -0500 Subject: [PATCH 06/11] typo --- people.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/people.go b/people.go index e685aa6..9274f12 100644 --- a/people.go +++ b/people.go @@ -401,8 +401,8 @@ type PersonImage struct { // PersonImages type is a struct for images JSON response. type PersonImages struct { - LogoProfiless []PersonImage `json:"profiles"` - ID int `json:"id,omitempty"` + Profiless []PersonImage `json:"profiles"` + ID int `json:"id,omitempty"` } // GetPersonImages get the images for a person. From 162a2606a8518572cb4283f380f248ae8c444f0c Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:07:02 -0500 Subject: [PATCH 07/11] typo --- tv_episodes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tv_episodes.go b/tv_episodes.go index 5a6356b..649b541 100644 --- a/tv_episodes.go +++ b/tv_episodes.go @@ -265,8 +265,8 @@ type TVEpisodeImage struct { // TVEpisodeImages type is a struct for images JSON response. type TVEpisodeImages struct { - ID int64 `json:"id,omitempty"` - Stills []TVEpisodeImages `json:"stills"` + ID int64 `json:"id,omitempty"` + Stills []TVEpisodeImage `json:"stills"` } // GetTVEpisodeImages get the images that belong to a TV episode. From 18e3b71377c36a4f44332360c553bcd9be16cd89 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:08:43 -0500 Subject: [PATCH 08/11] typo --- tv_seasons.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tv_seasons.go b/tv_seasons.go index 02b8d8f..bb79042 100644 --- a/tv_seasons.go +++ b/tv_seasons.go @@ -249,8 +249,8 @@ type TVSeasonImage struct { // TVSeasonImages type is a struct for images JSON response. type TVSeasonImages struct { - ID int64 `json:"id,omitempty"` - Logos []TVSeasonImage `json:"posters"` + ID int64 `json:"id,omitempty"` + Posters []TVSeasonImage `json:"posters"` } // GetTVSeasonImages get the images that belong to a TV season. From 67e64435654241a47b6ae416757e93b6a27b6b34 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:12:34 -0500 Subject: [PATCH 09/11] Extract CollectionImage struct --- collections.go | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/collections.go b/collections.go index ec157af..5fd98c3 100644 --- a/collections.go +++ b/collections.go @@ -46,27 +46,22 @@ func (c *Client) GetCollectionDetails( return &collectionDetails, nil } +// CollectionImage type is a struct for a single image. +type CollectionImage struct { + AspectRatio float32 `json:"aspect_ratio"` + FilePath string `json:"file_path"` + Height int `json:"height"` + Iso639_1 string `json:"iso_639_1"` + VoteAverage float32 `json:"vote_average"` + VoteCount int64 `json:"vote_count"` + Width int `json:"width"` +} + // CollectionImages type is a struct for images JSON response. type CollectionImages struct { - ID int64 `json:"id"` - Backdrops []struct { - AspectRatio float32 `json:"aspect_ratio"` - FilePath string `json:"file_path"` - Height int `json:"height"` - Iso639_1 string `json:"iso_639_1"` - VoteAverage float32 `json:"vote_average"` - VoteCount int64 `json:"vote_count"` - Width int `json:"width"` - } `json:"backdrops"` - Posters []struct { - AspectRatio float32 `json:"aspect_ratio"` - FilePath string `json:"file_path"` - Height int `json:"height"` - Iso639_1 string `json:"iso_639_1"` - VoteAverage float32 `json:"vote_average"` - VoteCount int64 `json:"vote_count"` - Width int `json:"width"` - } `json:"posters"` + ID int64 `json:"id"` + Backdrops []CollectionImages `json:"backdrops"` + Posters []CollectionImages `json:"posters"` } // GetCollectionImages get the images for a collection by id. From 261245f6ea47df3749a97b2b90551f38e6e80557 Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:13:48 -0500 Subject: [PATCH 10/11] typos --- collections.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/collections.go b/collections.go index 5fd98c3..2e0cf11 100644 --- a/collections.go +++ b/collections.go @@ -59,9 +59,9 @@ type CollectionImage struct { // CollectionImages type is a struct for images JSON response. type CollectionImages struct { - ID int64 `json:"id"` - Backdrops []CollectionImages `json:"backdrops"` - Posters []CollectionImages `json:"posters"` + ID int64 `json:"id"` + Backdrops []CollectionImage `json:"backdrops"` + Posters []CollectionImage `json:"posters"` } // GetCollectionImages get the images for a collection by id. From d25c58058eba3bae6aa688bdb8c38e9a406357fe Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Tue, 19 Dec 2023 13:21:49 -0500 Subject: [PATCH 11/11] typo --- people.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/people.go b/people.go index 9274f12..951be6e 100644 --- a/people.go +++ b/people.go @@ -401,8 +401,8 @@ type PersonImage struct { // PersonImages type is a struct for images JSON response. type PersonImages struct { - Profiless []PersonImage `json:"profiles"` - ID int `json:"id,omitempty"` + Profiles []PersonImage `json:"profiles"` + ID int `json:"id,omitempty"` } // GetPersonImages get the images for a person.