tmdb - changes.go
1 package tmdb
2
3 import "net/url"
4
5 // Change represents the ID of an item change
6 type Change struct {
7 ID int64 `json:"id"`
8 Adult *bool `json:"adult"`
9 }
10
11 // Changes lists results from a change search
12 type Changes struct {
13 Results []Change `json:"results"`
14 Page int64 `json:"page"`
15 TotalPages int64 `json:"total_pages"`
16 TotalResults int64 `json:"total_results"`
17 }
18
19 // ChangesMovie returns all of the Movie changes within the last 24 hours, filtered by the given params
20 func (t *TMDB) ChangesMovie(params ...option) (*Changes, error) {
21 c := new(Changes)
22 if err := t.get(c, "/3/movie/changes", url.Values{}, params...); err != nil {
23 return nil, err
24 }
25 return c, nil
26 }
27
28 // ChangesTV returns all of the TV changes within the last 24 hours, filtered by the given params
29 func (t *TMDB) ChangesTV(params ...option) (*Changes, error) {
30 c := new(Changes)
31 if err := t.get(c, "/3/tv/changes", url.Values{}, params...); err != nil {
32 return nil, err
33 }
34 return c, nil
35 }
36
37 // ChangesPerson returns all of the Person changes within the last 24 hours, filtered by the given params
38 func (t *TMDB) ChangesPerson(params ...option) (*Changes, error) {
39 c := new(Changes)
40 if err := t.get(c, "/3/person/changes", url.Values{}, params...); err != nil {
41 return nil, err
42 }
43 return c, nil
44 }