Skip to content

Commit a211c48

Browse files
authored
fix: remove deprecated person tagged images endpoint (#88)
- Remove `PersonTaggedImages` and `PersonTaggedImagesAppend` structs - Remove deprecated `GetPersonTaggedImages` function - Remove associated test cases: - TestGetPersonTaggedImages - TestGetPersonTaggedImagesFail - TestGetPersonTaggedImagesWithOptions - Fix TestGetTVSeasonDetailsWithOptions test The `/person/{id}/tagged_images` endpoint has been deprecated by TMDB and is no longer functional. This change removes all related code to maintain a clean and functional codebase. BREAKING CHANGE: The `GetPersonTaggedImages` function and related types have been removed as the underlying TMDB API endpoint is no longer available. Users should use alternative endpoints for similar functionality.
1 parent 7f95ce6 commit a211c48

File tree

3 files changed

+1
-77
lines changed

3 files changed

+1
-77
lines changed

people.go

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type PersonDetails struct {
2424
*PersonCombinedCreditsAppend
2525
*PersonExternalIDsAppend
2626
*PersonImagesAppend
27-
*PersonTaggedImagesAppend
2827
*PersonTranslationsAppend
2928
}
3029

@@ -64,12 +63,6 @@ type PersonImagesAppend struct {
6463
Images *PersonImages `json:"images,omitempty"`
6564
}
6665

67-
// PersonTaggedImagesAppend type is a struct
68-
// for tagged images in append to response.
69-
type PersonTaggedImagesAppend struct {
70-
TaggedImages *PersonTaggedImages `json:"tagged_images,omitempty"`
71-
}
72-
7366
// PersonTranslationsAppend type is a struct
7467
// for translations in append to response.
7568
type PersonTranslationsAppend struct {
@@ -412,55 +405,6 @@ func (c *Client) GetPersonImages(
412405
return &personImages, nil
413406
}
414407

415-
// PersonTaggedImages type is a struct for tagged images JSON response.
416-
type PersonTaggedImages struct {
417-
ID int64 `json:"id"`
418-
PaginatedResultsMeta
419-
Results []struct {
420-
ImageBase
421-
Iso639_1 string `json:"iso_639_1"`
422-
MediaType string `json:"media_type"`
423-
Media struct {
424-
Popularity float32 `json:"popularity"`
425-
Video bool `json:"video"`
426-
PosterPath string `json:"poster_path"`
427-
ID int64 `json:"id"`
428-
Adult bool `json:"adult"`
429-
BackdropPath string `json:"backdrop_path"`
430-
OriginalLanguage string `json:"original_language"`
431-
OriginalTitle string `json:"original_title"`
432-
GenreIDs []int64 `json:"genre_ids"`
433-
Title string `json:"title"`
434-
Overview string `json:"overview"`
435-
ReleaseDate string `json:"release_date"`
436-
VoteMetrics
437-
} `json:"media"`
438-
} `json:"results"`
439-
}
440-
441-
// GetPersonTaggedImages get the images that this person has been tagged in.
442-
//
443-
// https://developers.themoviedb.org/3/people/get-tagged-images
444-
func (c *Client) GetPersonTaggedImages(
445-
id int,
446-
urlOptions map[string]string,
447-
) (*PersonTaggedImages, error) {
448-
options := c.fmtOptions(urlOptions)
449-
tmdbURL := fmt.Sprintf(
450-
"%s%s%d/tagged_images?api_key=%s%s",
451-
baseURL,
452-
personURL,
453-
id,
454-
c.apiKey,
455-
options,
456-
)
457-
personTaggedImages := PersonTaggedImages{}
458-
if err := c.get(tmdbURL, &personTaggedImages); err != nil {
459-
return nil, err
460-
}
461-
return &personTaggedImages, nil
462-
}
463-
464408
// PersonTranslations type is a struct for translations JSON response.
465409
type PersonTranslations struct {
466410
Translations []Translation `json:"translations"`

people_test.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,6 @@ func (suite *TMBDTestSuite) TestGetPersonImagesFail() {
147147
suite.NotNil(err)
148148
}
149149

150-
func (suite *TMBDTestSuite) TestGetPersonTaggedImages() {
151-
tomCruise, err := suite.client.GetPersonTaggedImages(tomCruiseID, nil)
152-
suite.Nil(err)
153-
suite.NotNil(tomCruise.ID)
154-
}
155-
156-
func (suite *TMBDTestSuite) TestGetPersonTaggedImagesFail() {
157-
suite.client.apiKey = ""
158-
_, err := suite.client.GetPersonTaggedImages(0, nil)
159-
suite.NotNil(err)
160-
}
161-
162-
func (suite *TMBDTestSuite) TestGetPersonTaggedImagesWithOptions() {
163-
options := make(map[string]string)
164-
options["language"] = "en-US"
165-
tomCruise, err := suite.client.GetPersonTaggedImages(tomCruiseID, options)
166-
suite.Nil(err)
167-
suite.NotNil(tomCruise.ID)
168-
}
169-
170150
func (suite *TMBDTestSuite) TestGetPersonTranslations() {
171151
tomCruise, err := suite.client.GetPersonTranslations(tomCruiseID, nil)
172152
suite.Nil(err)

tv_seasons_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (suite *TMBDTestSuite) TestGetTVSeasonDetailsWithOptions() {
1717
options["language"] = "pt-BR"
1818
got, err := suite.client.GetTVSeasonDetails(gotID, 1, options)
1919
suite.Nil(err)
20-
suite.Equal("Temporada", got.Name)
20+
suite.Equal("Temporada 1", got.Name)
2121
}
2222

2323
func (suite *TMBDTestSuite) TestGetTVSeasonChange() {

0 commit comments

Comments
 (0)