Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract TVImage and add Logos for TV series #49

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions tv.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ type TVAccountStates struct {
// If it belongs to your favourite list.
//
// https://developers.themoviedb.org/3/tv/get-tv-account-states
//
func (c *Client) GetTVAccountStates(
id int,
urlOptions map[string]string,
Expand Down Expand Up @@ -568,27 +567,23 @@ func (c *Client) GetTVExternalIDs(
return &tvExternalIDs, nil
}

// TVImage type is a struct for a single image.
type TVImage 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"`
}

// TVImages type is a struct for images JSON response.
type TVImages struct {
ID int64 `json:"id,omitempty"`
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,omitempty"`
Backdrops []MovieImage `json:"backdrops"`
Logos []MovieImage `json:"logos"`
Posters []MovieImage `json:"posters"`
}

// GetTVImages get the images that belong to a TV show.
Expand Down
Loading