Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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