Skip to content

Commit

Permalink
Discover filter: prepare to get show genres
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Mar 22, 2024
1 parent fcfe569 commit e6d13b9
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.uwetrottmann.tmdb2.entities.BaseTvShow
import com.uwetrottmann.tmdb2.entities.Credits
import com.uwetrottmann.tmdb2.entities.DiscoverFilter
import com.uwetrottmann.tmdb2.entities.DiscoverFilter.Separator.OR
import com.uwetrottmann.tmdb2.entities.Genre
import com.uwetrottmann.tmdb2.entities.Person
import com.uwetrottmann.tmdb2.entities.TmdbDate
import com.uwetrottmann.tmdb2.entities.TvEpisode
Expand Down Expand Up @@ -228,6 +229,20 @@ class TmdbTools2 {
return null
}

suspend fun getShowGenres(tmdb: Tmdb, language: String): List<Genre>? {
try {
val response = tmdb.genreService().tv(language).awaitResponse()
if (response.isSuccessful) {
return response.body()?.genres
} else {
Errors.logAndReport("load show genres", response)
}
} catch (e: Exception) {
Errors.logAndReport("load show genres", e)
}
return null
}

fun getShowTrailerYoutubeId(
context: Context,
showTmdbId: Int,
Expand Down

0 comments on commit e6d13b9

Please sign in to comment.