Skip to content

Commit

Permalink
Add logos to TmdbImages response
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Snoek authored and ChrisKruegerDev committed Jul 30, 2024
1 parent 0df1580 commit 59c7d82
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ data class TmdbVideo(
data class TmdbImages(
@SerialName("id") val id: Int? = null,
@SerialName("posters") val posters: List<TmdbFileImage> = emptyList(),
@SerialName("backdrops") val backdrops: List<TmdbFileImage> = emptyList()
@SerialName("backdrops") val backdrops: List<TmdbFileImage> = emptyList(),
@SerialName("logos") val logos: List<TmdbFileImage> = emptyList()
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class TmdbMoviesApiTest {
assertThat(images.id).isEqualTo(10140)
assertThat(images.backdrops.size).isEqualTo(2)
assertThat(images.posters.size).isEqualTo(14)
assertThat(images.logos.size).isEqualTo(2)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class TmdbShowsApiTest {
assertThat(images).isNotNull()
assertThat(images?.posters).isNotEmpty()
assertThat(images?.backdrops).isNotEmpty()
assertThat(images?.logos).isNotEmpty()
}
}

Expand Down Expand Up @@ -116,6 +117,7 @@ class TmdbShowsApiTest {
assertThat(images.id).isEqualTo(96677)
assertThat(images.backdrops.size).isEqualTo(14)
assertThat(images.posters.size).isEqualTo(3)
assertThat(images.logos.size).isEqualTo(3)

val poster = images.posters.first()
assertThat(poster.height).isEqualTo(1500)
Expand Down
21 changes: 19 additions & 2 deletions tmdb-api/src/jvmTest/resources/tmdb3/movie/movie_images_10140.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,24 @@
],
"id": 10140,
"logos": [

{
"aspect_ratio": 2.664,
"height": 372,
"iso_639_1": "en",
"file_path": "/oVy4qtKNJRI1q8NHZPpNM02g2FH.png",
"vote_average": 5.312,
"vote_count": 1,
"width": 991
},
{
"aspect_ratio": 2.97,
"height": 862,
"iso_639_1": "en",
"file_path": "/1I62ZqyJFG1uicLURKUTu9LzsHU.png",
"vote_average": 0,
"vote_count": 0,
"width": 2560
}
],
"posters": [
{
Expand Down Expand Up @@ -151,4 +168,4 @@
"width": 1012
}
]
}
}
32 changes: 30 additions & 2 deletions tmdb-api/src/jvmTest/resources/tmdb3/tv/tv_images_96677.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,35 @@
}
],
"id": 96677,
"logos": [],
"logos": [
{
"aspect_ratio": 3.168,
"height": 250,
"iso_639_1": "fr",
"file_path": "/1JrVoNHy7VTJCKV60sDJGCcBL1H.png",
"vote_average": 5.312,
"vote_count": 1,
"width": 792
},
{
"aspect_ratio": 3.257,
"height": 206,
"iso_639_1": "fr",
"file_path": "/tTXclx8r0ctDJx3QkiMVaWGchEd.png",
"vote_average": 5.172,
"vote_count": 1,
"width": 671
},
{
"aspect_ratio": 4.087,
"height": 207,
"iso_639_1": "uk",
"file_path": "/nS5kcjU94pMSjdNRP2m2dVlhVM2.png",
"vote_average": 0.0,
"vote_count": 0,
"width": 846
}
],
"posters": [
{
"aspect_ratio": 0.667,
Expand Down Expand Up @@ -158,4 +186,4 @@
"width": 1000
}
]
}
}

0 comments on commit 59c7d82

Please sign in to comment.