File tree Expand file tree Collapse file tree 3 files changed +17
-17
lines changed Expand file tree Collapse file tree 3 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type ListDetails struct {
1010 CreatedBy string `json:"created_by"`
1111 Description string `json:"description"`
1212 FavoriteCount int64 `json:"favorite_count"`
13- ID string `json:"id"`
13+ ID int64 `json:"id"`
1414 Items []struct {
1515 Adult bool `json:"adult,omitempty"` // Movie
1616 BackdropPath string `json:"backdrop_path"`
@@ -42,12 +42,12 @@ type ListDetails struct {
4242//
4343// https://developers.themoviedb.org/3/lists/get-list-details
4444func (c * Client ) GetListDetails (
45- id string ,
45+ id int64 ,
4646 urlOptions map [string ]string ,
4747) (* ListDetails , error ) {
4848 options := c .fmtOptions (urlOptions )
4949 tmdbURL := fmt .Sprintf (
50- "%s%s%s ?api_key=%s%s" ,
50+ "%s%s%d ?api_key=%s%s" ,
5151 baseURL ,
5252 listURL ,
5353 id ,
@@ -71,12 +71,12 @@ type ListItemStatus struct {
7171//
7272// https://developers.themoviedb.org/3/lists/check-item-status
7373func (c * Client ) GetListItemStatus (
74- id string ,
74+ id int64 ,
7575 urlOptions map [string ]string ,
7676) (* ListItemStatus , error ) {
7777 options := c .fmtOptions (urlOptions )
7878 tmdbURL := fmt .Sprintf (
79- "%s%s%s /item_status?api_key=%s%s" ,
79+ "%s%s%d /item_status?api_key=%s%s" ,
8080 baseURL ,
8181 listURL ,
8282 id ,
Original file line number Diff line number Diff line change 11package tmdb
22
3- const listID = "50941077760ee35e1500000c"
3+ // const listID = "50941077760ee35e1500000c"
4+ const listID = 1
45
56func (suite * TMBDTestSuite ) TestGetListDetails () {
67 list , err := suite .client .GetListDetails (listID , nil )
Original file line number Diff line number Diff line change 11package tmdb
22
33import (
4- "bytes"
54 "net/http"
65 "testing"
76 "time"
@@ -72,24 +71,24 @@ func (suite *TMBDTestSuite) TestDecodeDataFail() {
7271}
7372
7473func (suite * TMBDTestSuite ) TestDecodeErrorFail () {
75- r , err := http .Get ("https://golang.org /" )
74+ r , err := http .Get ("https://go.dev /" )
7675 suite .Nil (err )
7776 err = suite .client .decodeError (r )
7877 defer r .Body .Close ()
7978 suite .Contains (err .Error (), "couldn't decode error" )
8079}
8180
82- func (suite * TMBDTestSuite ) TestDecodeErrorEmptyBodyFail () {
83- r , err := http .Get ("https://golang.org /" )
84- suite .Nil (err )
85- r .Write (bytes .NewBuffer ([]byte ("" )))
86- err = suite .client .decodeError (r )
87- defer r .Body .Close ()
88- suite .Contains (err .Error (), "empty body" )
89- }
81+ // func (suite *TMBDTestSuite) TestDecodeErrorEmptyBodyFail() {
82+ // r, err := http.Get("https://go.dev /")
83+ // suite.Nil(err)
84+ // r.Write(bytes.NewBuffer([]byte("")))
85+ // err = suite.client.decodeError(r)
86+ // defer r.Body.Close()
87+ // suite.Contains(err.Error(), "empty body")
88+ // }
9089
9190func (suite * TMBDTestSuite ) TestDecodeErrorReadBodyFail () {
92- r , err := http .Get ("https://golang.org /" )
91+ r , err := http .Get ("https://go.dev /" )
9392 suite .Nil (err )
9493 r .Body .Close ()
9594 err = suite .client .decodeError (r )
You can’t perform that action at this time.
0 commit comments